Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I move value from one form to another 1

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
0
0
US
I originally posted this under the javascript forum but was told it was the wrong place. Hopefully, this is the correct forum now.

I am a very very new to this language and am confused.

I have a jsp page that I put an input box.
I want to take that input value and pass it to another page which will eventually be used as a crystal reports parameter. Right now I would be happy to just be able to see the value on the 2nd page.

I am able to go to a second jsp page but I haven't been able to pass the value.

Does anyone have any recommendations on what to read or code suggestions?

I have:

Code:
[COLOR=blue]Dataform.jsp[/color]
Enter Employee Name 
<h:inputText id="empName" styleClass="inputText" ></h:inputText>
<br>
<br>
View/Print Report </hx:jspPanel>
<hx:commandExButton type="submit" value="Submit" id="btnReport" styleClass="commandExButton" style="background-color: #eaffff"
action="#pc_DataForm.goToReportTest}">
</hx:commandExButton>

[COLOR=blue]ON Dataform.java [/color]
public String goToReportTest(){
  return "REPORTTEST";
 }
I enter data on the inputbox and click submit which takes me to the next page ok but I don't know how to take the value from one page and display it on another page.
Any suggestions/help are definitely appreciated. I have spent 3 days just getting this far.
thanks
lhuffst
 
forma.htm
Code:
<html>
<head>
</head>
<body>
<form action="formb.jsp" name="form1" method="post">
<input type="text" name="firstname">
<input type="checkbox" name="check1" value="Y">
<input type="submit" value="submit">
</form>
</body>
</html>
formb.jsp
Code:
<%
String firstNameStr = request.getParameter("firstname");
String checkStr = request.getParameter("check1");
%>
<html>
<head>
</head>
<body>
<form action="" name="form2">
<input type="text" name="firstname" value="<%if (firstNameStr!=null) {out.print(firstNameStr);}
%>">
<input type="checkbox" name="check1" <%if (checkStr!=null && checkStr.equals("Y")) {out.print("checked");}
%>>
</form>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top