thody
08-13-2005, 07:45 PM
So, I have a form on my page, with a field that is generated on the fly with innerHTML. The field is being created just fine, the problem is that its value is not being submitted at all.
The field is created like this:
(inputfield is a table cell)
var inputfield = document.getElementById('inputfield');
inputfield.innerHTML = '<input name="q" type="text" id="q" size="25" />';
The field is created properly, but the value does not occur in the POST variables when the form is submitted (Yes the method of the form is POST).
Is there something I have to do to activate the field after it's created or something?
At first I thought perhaps the name wasn't being applied to the field, but after it's created I tried this, and it found the field, and printed alerted 'q':
var field = document.getElementById('q');
alert(field.name);
The field is created like this:
(inputfield is a table cell)
var inputfield = document.getElementById('inputfield');
inputfield.innerHTML = '<input name="q" type="text" id="q" size="25" />';
The field is created properly, but the value does not occur in the POST variables when the form is submitted (Yes the method of the form is POST).
Is there something I have to do to activate the field after it's created or something?
At first I thought perhaps the name wasn't being applied to the field, but after it's created I tried this, and it found the field, and printed alerted 'q':
var field = document.getElementById('q');
alert(field.name);