I try build input dynamic with button(Add Item). and I have combobox(1-6) for limit item input. I need disable combobox for human error when input data.
E.g User select max = 2(user will be add item 2 times), After user input value in product next user click (Add Item), then combobox will be disable (when user click add item), next repeated user input until limit.
This for html Max Item(combobox) :
<tr>
<td>
Max Item
</td>
<td>
:
</td>
<td>
<select name="max" id="maxitem">
<?php
for($i=1; $i<=6; $i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>
PRODUCT :
</td>
<td>
<input type="text" name="product" value="">
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td><input type="button" id="ADD" value="Add Item"></td>
<td><input type="reset" id="RESET" value="Reset"></td>
</tr>
</table>
</td>
</tr>
And this for javascript :
function restFormOpts()
{
if(isSet === isAllowed) {
$("#ADD").attr("disabled",true);
$("#maxitem").attr("disabled",false);
}
else {
$("#ADD").attr("disabled",false);
$("#maxitem").attr("disabled",true);
}
}
This code already work well, but when combobox disable value will be gone too.
I cant post data $max = $_POST['max']; // THIS NULL IF COMBOBOX DISABLE
Some one have any idea???