How to alert user, if radio box and check box is not selected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • traine
    New Member
    • Apr 2010
    • 1

    #1

    How to alert user, if radio box and check box is not selected

    If user do not click on any of these button, then how to alert to say select atleast 1 option for both the button(radio button & radio button)


    Gender:
    Code:
        <input type="radio" name="common" />Male
        <input type="radio" name="common" />Female
    Select your Hobbies:
    Code:
    	Swimming<input type="checkbox" name="check1" />
    	Playing<input type="checkbox" name="check2" />
    	Driving<input type="checkbox" name="check3" />
    	Riding<input type="checkbox" name="check4" />
    Last edited by Dormilich; Apr 26 '10, 06:58 AM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you could either define a default value (via the checked attribute) or loop over each group showing the alert, if every .checked property is false.

    Comment

    Working...