Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 22nd, 2007, 03:05 PM
Tyler
Guest
 
Posts: n/a
Default Name of the Form that was POSTed?

Is it possible to determine the name of the form that caused a page to
be submitted? I have seen numerous examples of how to determine the
method of the POST and how to retrieve data elements from the post,
but I haven't seen any way to know the name of the form that caused
the post.

The page that is POSTing to my script has two forms and I'd like to
know if I can determine which one of them was submitted without having
to add a hidden element to the forms.

Thanks, Tyler

  #2  
Old August 22nd, 2007, 03:35 PM
Michael Fesser
Guest
 
Posts: n/a
Default Re: Name of the Form that was POSTed?

..oO(Tyler)
Quote:
>Is it possible to determine the name of the form that caused a page to
>be submitted?
Forms don't have a name. Any 'name' or 'id' attributes applied to a form
can be used in client-side scripting, but are not submitted to the
server.
Quote:
>The page that is POSTing to my script has two forms and I'd like to
>know if I can determine which one of them was submitted without having
>to add a hidden element to the forms.
IMHO using a hidden element is the most reliable and safest way.

Another way would be to give the submit buttons in each form different
names and check which button was pressed, but this might not always work
as expected.

Micha
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles