made some more changes... used to scroll to the top when you type. now it stays with the cursor.
same URL.
but twey, your code outputs some odd behavior. for some reason the last character is outputted when a new one is typed...
Printable View
made some more changes... used to scroll to the top when you type. now it stays with the cursor.
same URL.
but twey, your code outputs some odd behavior. for some reason the last character is outputted when a new one is typed...
Hmm? Output? What output? :)
That was just an example of caret code using an expanding textbox, there's no output involved.
Oh i thought it was an addon for sachi's code. NVM then...
Sorry Twey, but I've got this habit of using the $ function because of firebug. I will try to avoid it as much as possible.Quote:
Originally Posted by Twey
What should I use then? I guess I should use <element>.firstChild.firstChild.textValue but I don't usually use that because of the extra #text nodes netscape browsers insert instead of a newline.Quote:
Originally Posted by Twey
I was about to use the same technique but unfortunately, I couldn't make the default caret disappear so ... I had to think of a new technique.
EDIT: boxxertrumps: Here's the function to send a request when the user hits enter:
Add the following code after the
part:Code:if(e.ctrlKey && e.keyCode == 65){
$("writer").style.backgroundColor = "#99ccff";
} else {
$("writer").style.backgroundColor = "";
}
That should work.Code:if(e.keyCode == 13){
sendAjaxRequest(document.getElementById("your_textarea_id").value);
document.getElementById("your_textarea_id").value = "";
return false;
}
It would be appropriate to use separate <code> elements for each line, or replace linebreaks with <br> elements as you have been doing.Quote:
What should I use then? I guess I should use <element>.firstChild.firstChild.textValue but I don't usually use that because of the extra #text nodes netscape browsers insert instead of a newline.
Twey: I am sorry but, I didn't get what you meant by:
How would using code elements help me write the data into the div?Quote:
Originally Posted by Twey
php doc i have so far... no error support, ill have to add that later.
http://www.freewebs.com/boxxertrumps/carret.phps
EDIT: the code at the top is assuming there are multiple lines being sent and can be replaced with
$final = $_POST["com"];
You don't. You write the data into <code> elements inside the <div>, which are styled to be block-level, thus solving the line-break problem.Quote:
How would using code elements help me write the data into the div?
Twey: Ah ha!! My bad, sorry. :( I'll try to implement that right away. Thanks Twey!!
By the way I've found a bug and is listed in the original post. You can check it out if you want.