...

View Full Version : Resolved problems with using $_POST['submit']?



paddyfields
04-26-2012, 02:25 PM
Hi there

I've remember reading on the signature from a member of this board saying not to use isset($_POST['submit']) because of an IE bug. Instead I've always used hidden inputs with the name being used in the $_POST['namevalue'].

I'm now trying to create a single form with 2 submit buttons but this only seems to work if I use 2 actual submit buttons to send the POST data (instead of hidden as well)

After trying to research on the problem with using isset($_POST['submit']) I now can't find any articles saying it's a poor method.

Is this the case, are they OK to use??

paddyfields
04-26-2012, 02:36 PM
ah, sorry i just found the thread.

http://www.codingforums.com/showthread.php?p=1144368

I suppose it's worth reminding people any.

Cheers to tangoforce. :thumbsup:

tangoforce
04-26-2012, 04:46 PM
Hi

If you need two submit buttons, then you can use them for processing - the user has to choose between them (unless you have a submit and an edit button - then you may want to still use a hidden for submit but also check for a edit).

The bug relates to the key press of the return key if the cursor is in a text box. Typically with one submit button on the form the user will just hit return rather than grabbing the mouse and clicking the button however with two buttons they'll often need to decide hence you're guaranteed to get one of them (normally).

paddyfields
04-26-2012, 06:14 PM
Thank you. I took your advice on this for my forms when first reading it a while ago, but now have come to a situation where I need two submit buttons. Thankfully there are no input boxes so the return key problem is not an issue.

Cheers.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum