aspose file tools*
The moose likes JSP and the fly likes how to acces text box in same jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to acces text box in same jsp" Watch "how to acces text box in same jsp" New topic
Author

how to acces text box in same jsp

shivaram bupathi
Greenhorn

Joined: Oct 12, 2006
Posts: 4
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

Why do you want to store it if it's already in the textbox ? What are you trying to do ?


[My Blog]
All roads lead to JavaRanch
GS Chidam
Ranch Hand

Joined: Jul 07, 2006
Posts: 34
hi

before submitting the page or after submitting the page?
shivaram bupathi
Greenhorn

Joined: Oct 12, 2006
Posts: 4
Originally posted by GS Chidam:
hi

before submitting the page or after submitting the page?
shivaram bupathi
Greenhorn

Joined: Oct 12, 2006
Posts: 4
after submit button
GS Chidam
Ranch Hand

Joined: Jul 07, 2006
Posts: 34
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

Joined: Sep 01, 2006
Posts: 230
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

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 ?
 
jQuery in Action, 2nd edition
 
subject: how to acces text box in same jsp