Group disable/enable of input field based on radiobutton conditions

Discussion in 'JavaScript' started by antonken, May 8, 2008.

  1. #1
    Hi experts,

    This is my first post. Nice to meet you all guys.

    I have a coding issue.

    In my form, I have 4 radio buttons.

    1. Check
    2. Money Order
    3. Visa
    4. Mastercard

    Then I have a 4 credit card fields in the form of xxxx - xxxx - xxxx - xxxx

    When user chooses either Check or Money Order, the four fields for credit card number are to be disabled.

    But when user clicks on Visa or Mastercard, the credit card fields are to be enabled.

    Any experts can show me how to group enable and disabled 4 input fields at one go?

    Sorry, I can only do it for 1 input field but not all 4.

    Thanks for help!:)
     
    antonken, May 8, 2008 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    So you want the 4 card types disabled when they have selected money order, but when they click on one of the card types, you want it to select credit card and enabled that credit card? If i am wrong please correct me and I will help you.

    thanks :)
     
    crath, May 12, 2008 IP
  3. antonken

    antonken Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi crath,

    Yes, the 4 credit card input fields, xxxx - xxxx -xxxx -xxxx to be completely disabled when user click money order or check. Enable when 2 credit card options are clicked.

    Thanks for your help. :)
     
    antonken, May 13, 2008 IP