I want to achieve the following functionality using jQuery: I have a tr
which has to be repeated when +
is clicked and from next tr
onwards but +
and -
options should be available. Further to that, when the form is submitted I want to keep a record of all the <tr>
and the data.
<div class="clear clearfix table-eform" id="mandatoryConditions">
<table class="zytbl txDetGrid">
<tbody>
<tr class="tophead">
<td class="bld">
<?php echo lang( 'LBL_MANDATORY')?>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="mandatoryCondition">
<td>
<div class="frmInpt">
<select name="selRulelhsCondition" id="selRulelhsCondition" class="text frmEle">
<option value="">
<?php echo lang( 'LBL_SELECT')?>
</option>
<option value="1">
<div>Status</div>
</option>
</select>
</div>
</td>
<td>
<div class="frmInpt">
<select name="selRuleOperandCondition" id="selRuleOperandCondition" class="text frmEle">
<option value="">
<?php echo lang( 'LBL_SELECT')?>
</option>
<option value="1">
<div>Is equal to</div>
</option>
<option value="1">
<div>Is not equal to</div>
</option>
</select>
</div>
</td>
<td>
<div class="frmInpt">
<select name="selRulerhsCondition" id="selRulerhsCondition" class="text frmEle">
<option value="">
<?php echo lang( 'LBL_SELECT')?>
</option>
<option value="1">
<div>Inactive</div>
</option>
<option value="1">
<div>Pending</div>
</option>
<option value="1">
<div>Complete</div>
</option>
</select>
</div>
</td>
<td class="actTd action actions">
<a href="#" class="icon add actButtons dev_addMandatCondition" title="Add Mandatory Condition" onClick="addConditions();"></a>
<a href="#" class="icon remove actButtons dev_removeMandatCondition" title="Remove Mandatory Condition" style="display: none"></a>
</td>
</tr>
</tbody>
</table>
</div>