The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

more than one checkbox not be selected

Hai all, I am having a jsp page where i had some entries and a checkbox for each entry. Any user has to select one of the checkboxes and click the download button. This is working fine. But if more than one checkbox is selected, the download button should be disabled. I know that it is a bit of javasript stuff but am not getting it right. so please help me in this regard.

Hi, in this case we dont have only the download button but we have the delete button and such other buttons where a user can select more than one option. So we opted for the checkbox. He has to select only option when it comes to downlad button only, Can u suggest another solution...

u might use some logic like when user checks multiple checkboxes then automatically disable the download button and whatever button u like once user click only one check box ur code should enable both download or delete button

Yes sajjad, u r right? Thts wat i have been trying but i cant get any right idea for this approach. I am weak in javascript but i need a solution so fast. So if u can please give me an idea of how to start coding for this part. Once i get an idea i can implement it....

dear,
it's so simple. i'll let u know how to do that.
first of all make array of checkboxes.
take length.
u can take one counter variable with that.
u need to check how many checkboxes are checked while looping and inside this loop u can set counter value.
suppose user have checked 2 checkboxes then this counter has value 2
now after that u need to check if counter value is greater than or equals 2 then u should disable the download button other wise enable it.