NYCPHP Meetup

NYPHP.org

[nycphp-talk] Form names

Freedman, Tom S. tfreedma at ubspw.com
Tue Dec 10 09:56:03 EST 2002


Of course, doing all that is contingent on being able to modify the HTML
forms, which, from your question, I gather you can't do.  Your only other
real option is to look at what elements you DO get back, and try to pick a
processing routine based on that (e.g. if I have A & B but not C, use the
processing code for form 2).  That's a huge pain in the butt, but that's
HTML for ya.

-----Original Message-----
From: Analysis & Solutions [mailto:danielc at analysisandsolutions.com]
Sent: Monday, December 09, 2002 6:34 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Form names


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.


--- Unsubscribe at http://nyphp.org/list/ ---




More information about the talk mailing list