d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > How To Validate In Php
Add Reply New Topic New Poll
Member
Posts: 3,965
Joined: Jul 10 2011
Gold: 5,200.00
Nov 10 2015 09:45pm
how do you validate if a radio button is selected if the value is 0?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 10 2015 09:50pm
if(!isset($_POST['mycheckbox']))
Member
Posts: 3,965
Joined: Jul 10 2011
Gold: 5,200.00
Nov 10 2015 09:50pm
yeah i thought the same thing but it doesnt work

because isset doesnt considerate it since the value is 0

This post was edited by swtscp on Nov 10 2015 09:51pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 10 2015 09:53pm
Quote (swtscp @ Nov 10 2015 10:50pm)
yeah i thought the same thing but it doesnt work

because isset doesnt considerate it since the value is 0


you sure?

https://www.virendrachandak.com/techtalk/php-isset-vs-empty-vs-is_null/
Member
Posts: 3,965
Joined: Jul 10 2011
Gold: 5,200.00
Nov 10 2015 09:57pm
omg thx is_null() might work love you :)
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll