I want to know if an image button can be disabled? When the user has added in the number of questions they need:
if (qnum == <?php echo (int)$_SESSION['textQuestion']; ?>)
then I want to disable the image button, but how can this be done?
Below is what I attemted but it didn’t work:
//HTML
<a onclick="return plusbutton();">
<img src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage" name="plusbuttonrow"/>
</a>
...
//jquery
if (qnum == <?php echo (int)$_SESSION['textQuestion']; ?>) {
$(".plusimage").attr("disabled", "disabled");
}
Don’t use JQuery for that! Use just php
(Do you have an image for the disabled button?? Images/plussignDISABLED.jpg ?? )
EDIT I just changed qnum to a php variable $numberOfQuestions. I suppose this variable will hold the numer of questions that the user has done (same as your javascript qnum I suppose…)