• Post Reply Bookmark Topic Watch Topic
  • New Topic

obtain the form "name parameter"

 
Alejandro Montenegro
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to know if it's possible to obtain the the "name parameter" with a JSP.
example:
<form name="HelloWorld" method="POST" ...

As said I need the "form name" of the form that is making the request.. or any have an idea how to recognize what form sent the request.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That name is not part of a normal form request. Why not add a hidden field with the form name?
<input type="hidden" name="HelloWorld" value="true" >
Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would add that if you are using the form name to trigger some special behavior on the server, it'd be clearer to abstract the hidden value to what it is really representing rather than relying on the form name as a trigger.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't think of a single reason why one would need the form name to trigger something. Just have a seperate action for each form and call it good. I'd be interested in hearing your need for the form name.
 
Alejandro Montenegro
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks William for your answer. And no there is no special reason that it has to be the form name.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by A Montenegro:
Thanks William for your answer. And no there is no special reason that it has to be the form name.


So this was a curiosity question?
 
Alejandro Montenegro
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I was just asking if it was possible, Im not an expert on HTTP and was not sure if it sends that kind of information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!