unemployment Posted July 27, 2011 Share Posted July 27, 2011 I'm in the process of creating a registration for my site and I am doing it in a multi step format. In the first step, I need to check to see if the radio button has been checked and if it is, I'd like to post that value to the second step. Right now I have this, but I can't echo out the value of the $_POST['acc_type'] in step 2... <?php $step = 1; if((isset($_POST['continue_1'])) && ((isset($_POST['acc_type'])) && ((($_POST['acc_type']) == 0) && (($_POST['acc_type']) == 1)))) { $step = 2; echo $_POST['acc_type']; } else if(isset($_POST['continue_1']) && isset($_POST['acc_type']) && $_POST['acc_type'] == '') { echo '<p class="errormessage error">To create an account you must select a goal.</p>'; } if($step == 1) { ?> <form action="join.php?key=<?php echo $_GET["key"]; ?>" method="post" id="form" name="signup"> <fieldset class="fieldset2"> <legend>Primary Goal</legend> <h2 class="mts">What goal do you want to achieve?</h2> <div class="ptm pbs phm tcenter"> <input id="entButton" class="radioAlign" type="radio" name="selector" value="1" /> <label for="entButton" class="ent mrl">R.</label> <input id="invButton" class="radioAlign mll" type="radio" name="selector" value="0" /> <label for="invButton" class="inv">I.</label> </div> </fieldset> <div class="mbl pbl" id="continue"> <input type="submit" id="continuebtn" name="continue_1" value="Continue" /> <input type="hidden" name="acc_type" value="" /> </div> </form> Quote Link to comment https://forums.phpfreaks.com/topic/242978-if-radio-button-is-checked/ Share on other sites More sharing options...
teynon Posted July 27, 2011 Share Posted July 27, 2011 <input type="hidden" name="acc_type" value="" /> acc_type is always blank.... Quote Link to comment https://forums.phpfreaks.com/topic/242978-if-radio-button-is-checked/#findComment-1247988 Share on other sites More sharing options...
unemployment Posted July 27, 2011 Author Share Posted July 27, 2011 <input type="hidden" name="acc_type" value="" /> acc_type is always blank.... Yes, I am aware of that, but I don't know how to pull in the value from the checkbox. Quote Link to comment https://forums.phpfreaks.com/topic/242978-if-radio-button-is-checked/#findComment-1247992 Share on other sites More sharing options...
teynon Posted July 27, 2011 Share Posted July 27, 2011 echo $_POST['selector']; Quote Link to comment https://forums.phpfreaks.com/topic/242978-if-radio-button-is-checked/#findComment-1247994 Share on other sites More sharing options...
unemployment Posted July 27, 2011 Author Share Posted July 27, 2011 echo $_POST['selector']; thanks.... I forgot the echo.... Simple dumb mistake. Quote Link to comment https://forums.phpfreaks.com/topic/242978-if-radio-button-is-checked/#findComment-1247998 Share on other sites More sharing options...
unemployment Posted July 27, 2011 Author Share Posted July 27, 2011 echo $_POST['selector']; actually... that didn't seem to fix my problem because the selector isn't always posted first. For some reason it only works some times and fails other times. Any other thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/242978-if-radio-button-is-checked/#findComment-1248016 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.