Click to See Complete Forum and Search --> : Detemine what buttons user click


ljcharlie
05-10-2003, 02:03 PM
I have two buttons in my .shtml form page and in my .php result page, I want to determine which button the user click to submit the form to my .php page to process the form. I have tried this:

$btnSubmit = $HTTP_GET_VARS["btnSubmit"];

to get the value of $btnSubmit and then determine what the value is so I can process the request accordingly. However, I always get an error saying that I have an undefined index of btnSubmit. In my .shtml form page, the two buttons are defined with the same name except that the value property is different. Any help will be appreciated!

Many thanks in advance!

ljCharlie

AdamGundry
05-10-2003, 02:11 PM
Should you be using $HTTP_POST_VARS instead of $HTTP_GET_VARS (this depends on the form submission method being used)?

If this is not the solution, post a link to your code.

Adam

ljcharlie
05-10-2003, 02:33 PM
Here's the link to .php code page.

PHP code page (http://www.losociety.org/updResultpage.htm)

And here is the code for the form page.

Form page (http://www.losociety.org/formPage.htm)

And here is the form page.

Form page (http://www.losociety.org/updActivities.shtml)

ljCharlie

AdamGundry
05-10-2003, 04:43 PM
Try using <input type="submit"> instead of normal buttons, then calling verification() from the form's onsubmit event hander. Use "return false;" to prevent the form submitting if invalid data is entered.

Adam