Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to acces text box in same jsp

 
shivaram bupathi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can I retrive and store the contents (of a text box ) to a string in
the same jsp i.e., if "text1" is a textbox in a login1.jsp then i want to store the contents of the "text1" into a string "str1" in the same login1.jsp. is it possible? if so please reply me as quickly as possible

thanks in advance and grateful to every one who ever reply
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to store it if it's already in the textbox ? What are you trying to do ?
 
GS Chidam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

before submitting the page or after submitting the page?
 
shivaram bupathi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by GS Chidam:
hi

before submitting the page or after submitting the page?
 
shivaram bupathi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after submit button
 
GS Chidam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After submitting the page, you are using that text1 value isn't. If you are using text1 value, just put that value into session.

Then coming back to same jsp, call that session, then assign to str1. Before submitting the page, your session is null, after submitting, you must be having that text1 value in session.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think not 100 percent sure
if you are giving request to your jsp from other jsp or html page
then while submitting the jsp page on which you have your text box
give name of your current jsp name in action attribute of form tag
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you need to read something about "Submitting a form". The value of your textbox will be sent in the request when you submit the form.
To you want to get it back from a servlet, or from a JSP file ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic