JSP form

i am using <form name="form2"> in jsp code can i use form name(form2) in the name of some other variable name?Eg:String str=form2And then i wil use the str instead of form2
[220 byte] By [gobinatha] at [2007-11-27 2:25:29]
# 1
Can u explain in a better understanding way?what do u mean by giving this statment?String str=form2?
mshanua at 2007-7-12 2:33:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi My requirement is i hav 2 JSP 1. Main JSP2.Add JSPIn Add jsp the form name should same as the Main jsp.... so how can i get the value from Main JSP and put it in the Add jsp?
gobinatha at 2007-7-12 2:33:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
<% String name="ur form name" %><form name="<%=name%>"> happy?</form>
mshanua at 2007-7-12 2:33:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
How will i get the form name?
gobinatha at 2007-7-12 2:33:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
i really dont know what are u trying to acheive....u can very well hard code ur form name in both ur page...
mshanua at 2007-7-12 2:33:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
i should use the hard code....Moreover i am using the form name for the calling the Script only in that Add jsp.... So my Question is how i use the form name for javascript function in the Add JSP
gobinatha at 2007-7-12 2:33:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

I think I understand what you mean

you have main.jsp that contains a field as

<input type="text" name="form_name" />

You then want to use the value for the parameter "form_name" in add.jsp, the following code would work:

<form name="<%= request.getParameter("form_name") %>">

toon_macharisa at 2007-7-12 2:33:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
Hi gobinathUse a hidden field in your main.jsp. Give the form name to that field and get it in add.jsp and set it to add.jsp's form name
bachea at 2007-7-12 2:33:51 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...