Author
jsp stay with text fields
ramesh poorella
Ranch Hand
Joined: Jul 19, 2011
Posts: 42
posted Jul 28, 2011 07:19:30
0
hi,
if enter some text box fields in jsp after submitting button then these fields going and store in data base. but the jsp page must stay with the text fields on the browser..
how is it possible ?
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
posted Jul 28, 2011 08:53:10
0
It's not. You need to restore the values using the value attribute on the form elements
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
ramesh poorella
Ranch Hand
Joined: Jul 19, 2011
Posts: 42
posted Jul 28, 2011 22:35:24
0
How it will do that...
please provide sample code for that
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
posted Jul 28, 2011 22:38:02
0
You write the code -- then get help with it.
Use the EL and/or the JSTL to set a value into the value attribute of the form elements.
ramesh poorella
Ranch Hand
Joined: Jul 19, 2011
Posts: 42
posted Jul 28, 2011 23:06:07
0
this is my code...
i want restore barcode value only in my page after submitting...
<BODY>
<h1>RECEIPT INFORMATION</h1>
<%
session.setAttribute("bar",request.getParameter("bar"));
%>
<form name="f1" method="POST" >
IRefNum:       <input type="text" size="40" name="irefnum"/>
RefNum:        <input type="text" size="40" name="refnum"/>
FromDept:     <select type="hidden" id="frm" name="fdep" onchange="fun1(this)">
<option>select</option>
<option value="Management">Management</option>
<option value="Technical Affairs" >Technical Affairs</option>
</select>
FromSEC:     <select type="hidden" name="fsec">
<option value="-1">select</option>
</select>
TODept:       <select type="hidden" id="to" name="todep" onchange="fun3(this)" >
<option>select</option>
<option value="Management">Management</option>
<option value="Technical Affairs"> TECHNICALAFFAIRS</option>
</select>
TOSEC :      <select type="hidden" name="tosec">
<option value=""> -select - </option>
</select>
SUBJECT:   <input type="text" size="40" name="sub"/>
NOTES:     
<input type="text" size="40" name="notes"/>
<input type="button" name="save" value="SUBMIT" onclick="submitForm()"/>    
<input type="button" name="View" value="VIEW" onclick="viewData()"/>    
<input type="button" name="Delete" value="DELETE" onclick="deleteData()"/>    
</form>
</body>
i am putting code tags please find it...
Tarun Bolla
Ranch Hand
Joined: Jun 20, 2011
Posts: 85
posted Jul 29, 2011 02:16:07
0
Requirement is not clear...but my understanding is that
1)You have a form in jsp page
2)You submit it
3)Generate the bar code
4)Show it in browser in previous jsp page
If that is it...
You could have a check in jsp like...
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
posted Jul 29, 2011 08:14:14
0
As you started a new topic on this same question, this topic is closed. Please do not do that in the future.
subject: jsp stay with text fields