Below is the code where it looks to see if the number of rows added matches a number. E.g If the number is 5 , then if 5 rows has been added…
if (qnum == <?php echo (int)@$_POST['textQuestion']; ?>) {
//...code
}
I want to disable a hyperlink after the user adds the maximum number of rows they are allowed to add, then will it work if I put the .click() function in the if statement like below:
if (qnum == <?php echo (int)@$_POST['textQuestion']; ?>) {
$(".showGrid").click(function(event) {
event.preventDefault();
});
}
the hyperlink is below;
<span href="#" class="showGrid">[Open Grid]</span>
I would unbind all other click handlers first and then
preventDefault()and I wouldreturn false;as well.