Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

jsp stay with text fields

 
ramesh poorella
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
It's not. You need to restore the values using the value attribute on the form elements
 
ramesh poorella
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Report post to moderator

How it will do that...

please provide sample code for that
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 61
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 89
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
As you started a new topic on this same question, this topic is closed. Please do not do that in the future.
 
    Bookmark Topic Watch Topic
  • New Topic