Jump to content

Archived

This topic is now archived and is closed to further replies.

willpower

Yes / No Confirmation Buttonz

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.