I am creating a form with AJAX. The way I have created the form is by writing out the html form elements in the innerHTML of the div where I'm putting the form
div.innerHTML += ' <input type="text" name="day" id="eventDay" size="2" maxlength="2" value="'+response.day+'" />,';
div.innerHTML += ' 20<input type="text" name="year" id="eventYear" size="2" maxlength="2" value="'+response.year+'" /><br /><br />';
I've also tried doing this by using document.createElement('input');
but this is giving me problems as well. Once I have the form created, when I try to submit the values using another AJAX function, I am unable to access the values of the input boxes by using document.getElementById('eventDay').value;
for instance. I don't want to submit the form using HTTP directly, but would rather submit it with an AJAX function. I have no idea why I can't access the values of these input boxes from the other function. Please help!