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

remitting values

 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

I have designed a dynamic registration page in which i am verifying Login name already exists or not(i am verifying from servlet where all the details entered by the user get stored)and if the Login name is already there in database, servlet takes user back to original registration page alongwith all the details which user has entered on registration page so that user can only change his username and no need to fill up all the details again.

What i am doing is using Request.getParameter on the same registration page to reterive values again after checking in the database for username.

eg:

String Login=request.getParameter("member_login");
<input type="password" name="member_password" maxlength="20" value="<%=Login%>
Now it is working fine,

But my problem is I have provided one field as "Salutaion" in the registration form which has two options "Mr" and "Ms" ,
now as "Salutaion" fieled has two options "Mr" and "Ms" i am unable to retrive parameters back on my registration page. eg:

String Salutation=request.getParameter("Salutation");

<td style="background-color: #FFEAC5; border-style: inset; border-width: 0"><font style="font-size: 10pt; color: #000000">Salutation*</font></td><td style="background-color: #FFFFFF; border-width: 1"><select name="Salutation"><option value="--Select--"></option><option value="2" >Mr.</option><option value="1" >Ms.</option></select></td>

Please suggest what should i pass in the above value filed (i.e. value="2" and value="1") so that i will be able to retrive parameters on the registration page for field salutation.

please suggest at your earliest.

Also my another query is, once if the Login name already exist in database servlet will take me back to registration page. Now i would like my cursor in value field for Login name so that user can directly enter new login name.(i mean same as focus and select in javascript, but now i want this on jsp page)

please revert at your earliest. Thanks in advance.

Yogi.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after comeback on registration page you need apply the if conditions like

Example code:



use same code for <select> is value is not equal to null then set this value inside the selected attribute.

hope it helps..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you were using modern standards -- using the EL as opposed to scriptlets -- this would not be an issue.



would be all the code that you needed.
[ March 23, 2007: Message edited by: Bear Bibeault ]
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ranchers...will try and update you on the same.

Yogi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic