Question
Prevent button from working
I have the following code :
<tr>
<td class="TitleText" align="center"><cfinput type="text" name="conditionCode" id="conditionCode" size="4" tabindex="25"></td>
<td class="TitleText" align="center"><cfinput type="text" name="materialNumber" id="materialNumber" size="20" tabindex="26"></td>
<td class="TitleText" align="center"><cfinput type="text" name="quantity" id="quantity" size="8" value="0" tabindex="27"></td>
<td class="TitleText" align="center"><cfinput type="text" name="unitValue" size="8" value="0.00" tabindex="28"></td>
<td class="TitleText" align="center"><cfinput type="text" name="snFlag" id="snFlag" size="1" tabindex="29"></td>
<td class="TitleText" align="center"><input type="button" value="Delete" onclick="removeRow(this);"/></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<input type="button" value="Add Another Material Number" onclick="addMaterialNumbers();" />
<br>
If I click the button Add Another Material Number, it will call a javascript function and dynamcially add anohter row after the first one.
However, if they submit the form with the new row called, and no entries in the original row, it blows up.
If they submit the form without adding the new row, another javascript function validation is called to verify that each of the cells/TD in the origianl row have a value in them.
Is there a way to prevent/disable the add new row button from working if no entries are made in the original row ?
<tr>
<td class="TitleText" align="center"><cfinput type="text" name="conditionCode" id="conditionCode" size="4" tabindex="25"></td>
<td class="TitleText" align="center"><cfinput type="text" name="materialNumber" id="materialNumber" size="20" tabindex="26"></td>
<td class="TitleText" align="center"><cfinput type="text" name="quantity" id="quantity" size="8" value="0" tabindex="27"></td>
<td class="TitleText" align="center"><cfinput type="text" name="unitValue" size="8" value="0.00" tabindex="28"></td>
<td class="TitleText" align="center"><cfinput type="text" name="snFlag" id="snFlag" size="1" tabindex="29"></td>
<td class="TitleText" align="center"><input type="button" value="Delete" onclick="removeRow(this);"/></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<input type="button" value="Add Another Material Number" onclick="addMaterialNumbers();" />
<br>
If I click the button Add Another Material Number, it will call a javascript function and dynamcially add anohter row after the first one.
However, if they submit the form with the new row called, and no entries in the original row, it blows up.
If they submit the form without adding the new row, another javascript function validation is called to verify that each of the cells/TD in the origianl row have a value in them.
Is there a way to prevent/disable the add new row button from working if no entries are made in the original row ?
