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 Link to comment https://forums.phpfreaks.com/topic/12861-yes-no-confirmation-buttonz/ 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. Link to comment https://forums.phpfreaks.com/topic/12861-yes-no-confirmation-buttonz/#findComment-49347 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] Link to comment https://forums.phpfreaks.com/topic/12861-yes-no-confirmation-buttonz/#findComment-49371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.