Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    radio buttons required needed!

    How can i check if the user selected a real value, and not leave the radio buttons?

    PHP Code:
    <input type="radio" value="1" checked name="payment">

    // AND

    <input type="radio" value="2" checked name="payment"
    The radio button is my first time to use it. I never try it with validation.

    How do you take off 'no black spot on it'!?!
    The user must select! If he/she leave it on then it'll be required validation!

    Here:

    PHP Code:
        if ($_POST['whatever'] == '1,2'){ 
            echo 
    'you need to select a whatever !.'
    That don't work

    I know how to code php required field validation in only one time but not two radio buttons.

    Thanks
    http://e-hosti.com :: Our low cost web hosting packages... 99% Uptime... 30 Day Money Back Guarantee...

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't understand.

    What exactly are you trying to do?
    How do you take off 'no black spot on it'!?!
    Do you mean tou want to display the radiobuttons without them being checked? then just remove the checked
    --><input type="radio" value="1" name="payment">

    And to see which one they seleced, it's just

    if (!isset($_POST['name']) or ($_POST['name']) < 1)){
    echo 'you need to select a whatever !.';
    }
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    wicked, thanks
    http://e-hosti.com :: Our low cost web hosting packages... 99% Uptime... 30 Day Money Back Guarantee...


  •  

    Posting Permissions

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