Jump to content

[SOLVED] INPUT TYPE=RADIO


denoteone

Recommended Posts

what sort of php if statement can I use to make sure that on submit the user has atleast select yes or no

 

<INPUT TYPE=RADIO NAME="otherdata" VALUE="Yes">YES<br/>
<INPUT TYPE=RADIO NAME="otherdata" VALUE="No">NO<br/>

would it check to see if it is null? any help would be awesome.

 

thanks,

Link to comment
https://forums.phpfreaks.com/topic/148848-solved-input-typeradio/
Share on other sites

Javascript, not html or php.

 

If you want php to check it (it would require a pagereload).

 

if (!isset($_POST['otherdata']) || ($_POST['otherdata'] != "Yes" && $_POST['otherdata'] != "No")) {
    echo "Required field missing.";
}

 

But you probably want Javascript instead.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.