This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting data in two text boxes

 
sonali duggi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
sonali duggi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello Ankit Garg

thanks for your reply.. it's really good and simple..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic