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...
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.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
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.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.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; }
Last edited by shachi; 02-17-2007 at 01:24 PM.
It would be appropriate to use separate <code> elements for each line, or replace linebreaks with <br> elements as you have been doing.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 understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
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?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"];
Last edited by boxxertrumps; 02-17-2007 at 06:17 PM.
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.How would using code elements help me write the data into the div?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
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.
Bookmarks