Expand|Select|Wrap|Line Numbers
- ....
- var inputElement = document.createElement("input");
- this.inputElement.name= "fieldName";
- this.inputElement.type = "text";
- this.inputElement.value = "somevalue";
- ....
like :
document.forms[0]['fieldName'].value
The code works fine in FireFox,
but in IE(6), I found that the name of the inputElement is gone.
So I wrote some other script to change input element's name,
It still not work( but works in FireFox).
I have a input element in form, and use a button to trigger the following function
Expand|Select|Wrap|Line Numbers
- function create()
- {
- alert("abc:" + document.forms[0]['abc'].value );
- document.forms[0]['abc'].setAttribute("name", "def");
- alert("def:" + document.forms[0]['def'] );
- }
Are there any one know what's going on?