[nycphp-talk] Form names
Oktay Altunergil
nyphp at altunergil.com
Tue Dec 10 16:27:58 EST 2002
I thought about this too.. But would you be able to address the forms like this on the 'submit' page?
Aren't these only available where the forms themselves are? If yes, then we're back to "I can't modify the HTML".
oktay
On Tue, 10 Dec 2002 16:25:26 -0500
jessica kelly <jkelly at sussex.cc.nj.us> wrote:
> If you can use Javascript try
>
> document.forms[0]. whatever for first form on page
> document.forms[1]. whatever for second form on page
> etc......
>
> Jessica
>
>
> >>> jellicle at inch.com 12/10/02 3:51:20 PM >>>
> On Tuesday 10 December 2002 15:05 pm, Timothy P Sailer wrote:
>
> > That's what I'm trying to do. My question is *how* to do this in PHP.
> > I'm completely stumped on this one. Mainly because this is so stupid
> > that I have do this, and I'm pissed.
>
> Look, this is straightforward. On the receiving page, all you have is
> the form variables and the action= URL. That's it. If there's a
> difference between those variables, you can tell the forms apart. If
> not, you can't. Period, full stop. If someone writes an (idiotic) form
> like this:
>
> ----------------------------------------
>
> Enter employee ID to fire:
>
> <FORM ACTION="process.cgi">
> <INPUT NAME="ID" TYPE="text">
> <INPUT TYPE="submit" VALUE="submit">
> </FORM>
>
> Enter employee ID to promote:
>
> <FORM ACTION="process.cgi">
> <INPUT NAME="ID" TYPE="text">
> <INPUT TYPE="submit" VALUE="submit">
> </FORM>
>
> ----------------------------------------
>
> . then you can't tell them apart, period. Quit trying. It's their
> fault. The form needs to be changed. The typical approaches are to
> modify the action= URL, or add a hidden form field.
>
> <INPUT TYPE="hidden" NAME="formaction" VALUE="promote">
>
> <FORM ACTION="process.cgi?formaction=promote">
>
>
> --
> Michael Sims
>
>
>
>
>
>
>
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---
>
>
More information about the talk
mailing list