jQuery代码:
<script>
$(document).ready(function() {
var ma = $("#qty").val();
var str = $("#reqid").val();
$("#myform").validate({
rules: {
issue_quant_str: {
max: ma
}
}
});
});
</script>
HTML:
<table>
<tr><td><?php echo $array['item_name']; ?></td>
<td><?php echo $array['quantity']; ?></td>
<input type="hidden" value="<?php echo $array['requisition_id']; ?>" id="reqid" />
<td>
<div id="maxdiv">
<input type="text" name="issue_quant_<?php echo $array ['requisition_id'];?>" value="<?php echo $array['quantity']; ?>" />
</div>
</td>
<input type="hidden" value="<?php echo $stock_qty; ?>" id="qty" />
<td><?php echo $stock_qty;?></td>
<td><input type="text" name="rem_<?php echo $array['requisition_id'];?>" required/></td>
</tr>
</table>
在这里,我希望将 var str 值与 issue_quant 连接。我没有得到 str 值。谁能帮帮我..