Safari Textarea bug
by bhartsock on Jun.01, 2007, under Javascript
Well, I came across another Safari bug dealing with forms today. Unfortunately, I discovered this problem months ago and compeltely forgot it. So I figured I should document the issue so when it arises again, I won’t waste any time searching for the solution.
Basically, like most other issues with forms on IE and Safari, this issue deals with setting values of elements before they are on the document. Before today, I thought that checkboxes and radios in IE were the main problem, but textareas also have issues.
Here is the hack I did to solve the problem:
1 2 3 4 5 6 7 8 9 10 | //While populating the form var form = Element.createHtml('<form><textarea name="some_textarea"/></form>'); form.some_textarea.value = form.some_textarea._value = 'Hello world'; //When appending the form to the document document.body.appendChild(form); //Safari fix form.some_textarea.value = form.some_textarea._value; |
If I am feeling chipper, I may even search through WebKit’s huge list of bugs to see if it needs to be reported. Hope this helps someone out there.
December 19th, 2008 on 11:56 pm
Hello! simply super resource