Function that decrements a number on tick of checkbox
Posted on 2005-03-02
I am looking for a function that will do this:
1.) I will predefine a number, eg 250. -> this need to be displayed, either in a readonly textbox or span or div....
2.) There will be about 1000 rows of record displayed in a table, each row will have a checkbox.
3.) On ticking the checkbox the number will decrease, i.e. 250 - 1
4.) On unticking the checkbox the number will increase, i.e. 250 + 1
5.) The user will not be able to tick anymore of the checkboxes if maximum is reached, i.e. 250 checked and the display will show 0
6.) Once the user has ticked the maximum (250) allowed records, only then he can submit the form. Nothing less and nothing more.
Thanks in advance.