For a quick test of the newline translation problem I was talking about, try this code. Press the first button to get a count of the characters in the field, and the second to replace the contents of the field with the same text but using \r\n instead of \n as newline. So render this in WebKit, press the first button to get a count of 12, press the second button to modify the field, press the first to get a count of 14, then manually modify the field (i.e. type a character and delete it) and press the first button and you'll get a count of 12 again. The correct behaviour, I believe, is to always return a count of 12, and if you test this in Firefox you'll see that's what happens there. <html> <head> <title>foo</title> <script type="text/javascript"> function foobar() { var textarea = document.getElementById("foo"); alert(textarea.value.length); } function bar() { var textarea = document.getElementById("foo"); //textarea.setSelectionRange(3,7); textarea.value = "A\r\ntext\r\nfield"; textarea.focus(); } </script> </head> <body> <p>Test</p> <form> <textarea id="foo">A text field</textarea> <br /> <input type="submit" onclick="foobar(); return false;" value="Length" /> <br /> <input type="submit" onclick="bar(); return false;" value="Modify" /> </form> </body> </html> -- Kevin Ballard kevin@sb.org http://www.tildesoft.com http://kevin.sb.org