I have made a form in php..There are a number of checkboxes in that form. I want that the user should not be able to select more than the specified number. For example, If 3 fields are required, the user should only be able to select 3 checkboxes out of 5. But the problem is that the number of fields required is different for every user. So is there any way to validate this using jsp and mysql . I really need ur help guys, so please reply... Thankss
Can you please tell me what script to use...cause im really stuck at this..and thanks for the quick response..
yes it is better to use JavaScript instead of jsp and if required no. is different from user to user then the required field must be in the database,get it from the db store in php variable and compare it in javascript.
Apologies, I do not have any at hand you will need to google for some of it. Or maybe if some members can give you a hint on where to get such java scripts.
I guess you guys dont understand the problem....Here is a screenshot of my page I you see the staff no. is already defined...and i want that only that many no. of chechboxes can be ticked. Please help me out guys...
Well the framing of your question is not clear to me. From your post it seems that you want to track and put conditions on 2 terms i.e. user and checkbox, as every user has a different set of checkbox credentials. From your given image its still not clear about your checkboxes are they dynamically created or static. Either way it can be track on client side with JavaScript or on server side through JSP. On client side using JavaScript write a function to validate it using onfocus event or on server side using JSP get the values of checkboxes array if dynamic and put your conditions to validate. If you know Ajax that is one more option. Regards, Gonzo