NYCPHP Meetup

NYPHP.org

[nycphp-talk] Form names

Analysis & Solutions danielc at analysisandsolutions.com
Mon Dec 9 18:33:48 EST 2002


Hey Tim:

On Mon, Dec 09, 2002 at 03:22:50PM -0500, Timothy P Sailer wrote:
>
> I've been asked to post process a canned HTML screen that has
> multiple named forms on it. I'm pulling a complete blank on
> how to get the name of the form the submit button was clicked on.
> Isn't this an HTML variable???

No.  The option I'd use is to use different values for the submit buttons.  
For example...

form for adding record...
   <input type="submit" name="Submit" value="Add" />

form for updating record...
   <input type="submit" name="Submit" value="Update" />

Similarly, you can add hidden form elements.

Oh, and of course, you can have the various forms be submitted to 
different scripts.

Or... :) you can add a query string to the form's action...
   <form method="post" action="script.php?source=firstform">

Enjoy,

--Dan

-- 
 The new Department of Homeland Security is exempt from:
    * the Freedom of Information Act   * procurement rules
    * labor collective bargaining      * whistle blower protection
 The real goal?  Eliminating government accountability.



More information about the talk mailing list