File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to get Form Name using TexyBox name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get Form Name using TexyBox name" Watch "How to get Form Name using TexyBox name" New topic
Author

How to get Form Name using TexyBox name

Nishita Jain
Ranch Hand

Joined: Mar 30, 2006
Posts: 97
Hello everyone,
i want to that How to get Form Name using TexyBox name.
suppose in 1 jsp page i have created 3 forms
In 1 of the forms i have included common.jsp file
now in that common.jsp file there is an textBox name Go.

what i want is Using that Go button i want to know the Action name and the Form name..
jsp will look something like this:
test.jsp-------------------------
< html form name=... action=...... >
.
.
.
< / html form >
< html form name=test action=test >
.
< input type.... name= Go value=... / >
.
< / html form >

< html form name=... action=...... >
.
.
.
< / html form >
On Click of Go what i want is that Action is ... and formname is ..... where
textbox name is GO..

i hope i am clear

thanks,
Nishita


Nishita
Kamesh Rao
Ranch Hand

Joined: Dec 24, 2006
Posts: 35
call the following function on click of the go button by passing an instance of textbox.

function getFormName(obj){
var formObj=obj.form;

alert(formObj.name);
alert(formObj.action);
}


Hope I got your question correct
Nishita Jain
Ranch Hand

Joined: Mar 30, 2006
Posts: 97
hello Kamesh
tahnks for the prompt reply.
but thing is that whta if there is a link instead of that button..
i want form name in Link. i m sorry i forgot to mension that

thanks,
Nishita
[ December 28, 2006: Message edited by: Nishita Jain ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Form Name using TexyBox name