Jump to content


Photo

Yes / No Confirmation Buttonz


  • Please log in to reply
2 replies to this topic

#1 willpower

willpower
  • Members
  • PipPipPip
  • Advanced Member
  • 296 posts
  • LocationWarrington, Cheshire, UK

Posted 25 June 2006 - 12:08 PM

Hi

AAt 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.

Thanks

Will


Wait...I've got it...Bollocks, it's gone again!

If at first you don't succeed....stop using ASP and get onto PHP

#2 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 25 June 2006 - 12:32 PM

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.

#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 25 June 2006 - 02:36 PM

html =

<input type="submit" name="confirm" value="Yes">
<input type="submit" name="confirm" value="No">

php =

if ($_POST['confirm'] == "No") {
  do something
} else if ($_POST['confirm'] == "Yes") {
  do something else
}





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users