#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    48
    Rep Power
    14

    clicking on a selected radio button


    I'm using 4 radio buttons to select the way a list of products is sorted. When the user selects a button, a submit event is triggered and
    PHP script resorts the list to releflect the selected sorting option.

    Is there a way to disable a selected radio button so the user can't click on it again while still alowing the other radio butons to be clicked
    preventing an unnessary submit event?
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,453
    Rep Power
    9645
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    48
    Rep Power
    14
    Thanks. I thought it would be a bit more complicated then simply usiing onchage rather then onclick.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    2
    Rep Power
    0
    Originally Posted by artoo
    I'm using 4 radio buttons to select the way a list of products is sorted. When the user selects a button, a submit event is triggered and
    PHP script resorts the list to releflect the selected sorting option.

    Is there a way to disable a selected radio button so the user can't click on it again while still alowing the other radio butons to be clicked
    preventing an unnessary submit event?
    U can manually dissable trigger code from this button, so the user can't click on it again
  8. #5
  9. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,109
    Rep Power
    4307
    I would add something like this to the event handler:
    Code:
    if(!this.checked || this.defaultChecked) return;
    More info.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo