aspose file tools*
The moose likes Struts and the fly likes getting data in two text boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting data in two text boxes" Watch "getting data in two text boxes" New topic
Author

getting data in two text boxes

sonali duggi
Greenhorn

Joined: Oct 09, 2009
Posts: 8
hello
i am using struts tags to display data in jsp.. my question is i was created two text fields name and name1.
if i type name in name field the name should come in name 1 field simultaniously..


some one please reply me

thanking you
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

How is this related to struts?? This seems a simple javascript problem to me. You need to trace the keypress event of the first textbox and copy the text of the first text box into the second one using DOM manipulation. Look at this (I'm using struts 2 tag as you didn't mention which version of struts are you using)



You can also use the disabled attribute on the second textbox if you don't want the user to be able to edit the value of the second text box but remember that then its value won't be submitted to the server...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
sonali duggi
Greenhorn

Joined: Oct 09, 2009
Posts: 8
hello Ankit Garg

thanks for your reply.. it's really good and simple..
 
 
subject: getting data in two text boxes