SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

    Thanks in advance.....

  2. #2
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Jaya in this case why don't you use the radio button
    that will be simpler option.
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.

  3. #3
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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...

  4. #4
    SitePoint Zealot sajjad's Avatar
    Join Date
    May 2005
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Last edited by sajjad; Jul 26, 2006 at 21:54.

  5. #5
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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....

    Thanks..........

  6. #6
    SitePoint Zealot sajjad's Avatar
    Join Date
    May 2005
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    i think u understand all this


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •