This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes get the form name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "get the form name" Watch "get the form name" New topic
Author

get the form name

Gayatri Sinha
Ranch Hand

Joined: Feb 13, 2006
Posts: 34
Hi,

I have a two forms

<form name="a" action="a.jsp" method="post">
.....
</form>

and one more form
<form name="b" action="b.jsp" method="post">
.....
</form>

and from these forms I am calling a javascript function that is written in a different file. In the function I want to get the name of the form "a" or "b".

Is it possible?

Thanks,
- Gayatri
Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Originally posted by Gayatri Sinha:
from these forms I am calling a javascript function


I have no idea what you mean by this. How are you calling a javascript function "from a form"?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: get the form name
 
Similar Threads
Trouble submitting form with 'onsubmit' handler defined
Loading multiple forms in single jsp
How to get Events associated with DOM elements ?
display html message on multiple form same action
Javascript error in Mac OS 9 IE 5