PHP radio button check if null

Posted by Dallox on Stack Overflow See other posts from Stack Overflow or by Dallox
Published on 2012-10-06T09:29:46Z Indexed on 2012/10/06 9:37 UTC
Read the original article Hit count: 133

Filed under:
|
|

So in class we get this school task where we need to check if one of the fields in unfilled and display an error. No we did this but for some strange reason it doesnt display a error when a radio button is unchecked. (textfield null check works fine) I've tried with a friend many possabilities but they all doesnt seem to work. We have been stuck at this task for 2 hours. Now we have tried making seperate if's but that doesnt seem to work too. These are the important parts:

<p>
<input type="hidden" name="taal" value="false">
    Choose a language
<input type="radio" name="taal" value="N"> Dutch
<input type="radio" name="taal" value="E"> English
<input type="radio" name="taal" value="S"> Spanish

if (@$_POST['taal'] == null){
echo "No Language gotten";
return;
}

© Stack Overflow or respective owner

Related posts about php

Related posts about forms