javascript created input[type="text'] doesn't post it's variable
- by ivannovak
hey there, I'm creating a series of input elements and for some reason their values aren't $_POSTing. Any light shed on the subject would be appreciated!
My current code is as follows:
javascript
Afields = 1;
function addAdultInput() {
if (Afields != 10) {
document.getElementById('adultMembers').innerHTML += "<input type='text' value='' name='adult_members_"+Afields+"' /><br />";
Afields += 1;
} else {
document.getElementById('adultMembers').innerHTML += "Only 10 Adult Member fields allowed.";
document.getElementById('addAdultMember').disabled=true;
}
}
HTML
<form name="form1" method="post" action="">
<tr>
<td class="style12" valign="top">Adult Members' Names:<br /><small>10 Max </small><input id="addAdultMember" type="button" onclick="addAdultInput()" name="add" value="Add Adult" /></td>
<td id="adultMembers">
<span class="erorr">*for paid members only</span><br />
<input type='text' value='' name='adult_members_0' /><br />
</td>
</tr>
<input type="submit" name="Submit" value="Register">
</form>