willpower Posted June 25, 2006 Share Posted June 25, 2006 HiAAt the end of a page I have two buttons...a yes...and a no. This is to alloe the user too vaidate that they have enetered their information correctly befor proceeding.Now I need to submit the form to self. The action in the form is correct, however i am trying to do the if (isset($_POST['NO'])) { do this}if (isset($_POST['YES'])) {do that}Should this work in principle or does this only work with a 'submit' button.ThanksWill Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 25, 2006 Share Posted June 25, 2006 Im pretty sure there is nothing wrong with having two submit buttons in a form, so you do use submit buttons but just use differant names for them. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted June 25, 2006 Share Posted June 25, 2006 html =[code]<input type="submit" name="confirm" value="Yes"><input type="submit" name="confirm" value="No">[/code]php =[code]if ($_POST['confirm'] == "No") { do something} else if ($_POST['confirm'] == "Yes") { do something else}[/code] Quote Link to comment 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.