html - PHP: Bootstrap Radio button value not showing -
i have bootstrap form 3 radio buttons. saving value variable can use save database , email.
html:
<form class="form-horizontal form-validate" id="signup-form" method="post"> <input type="hidden" name="signupform" /> <div class="control-group"> <label class="control-label">seed program</label> <div class="controls"> <input type="radio" name="signup" value="seed program" checked="checked"/> </div> </div> <div class="control-group"> <label class="control-label">gift wrap program</label> <div class="controls"> <input type="radio" name="signup" value="gift wrap" /> </div> </div> <div class="control-group"> <label class="control-label">sign both</label> <div class="controls"> <input type="radio" name="signup" value="both" /> </div> </div> <input type="submit" class="btn btn-large btn-block btn-success" value="submit" name="submit"> </form> php:
if(isset($_post['signupform'])){ if(isset($_post['signup'])) { $signup = $_post["signup"]; } else{ $signup = "nothing selected"; } } the problem:
the problem can value of first radio button has "checked" attribute. if select of other two, wont , value shows empty.
any appreciated.
thanks,
try using
<input type="radio" name="signup" value="seed program" checked /> and not
<input type="radio" name="signup" value="seed program" checked="checked"/>
Comments
Post a Comment