Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retreive the value

 
pavi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i add a textbox dynamically in onclick event and how to retrieve the dynamic textbox value in action class when i submit the form.
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have textbox which is hidden initially. Something like...

Now with the "onClick" event, associate a JS snippet like...

This will give you the desired behaviour at the client end. To retrieve the value of this textbox in your action class, have the getter/setter => [getTxtVal()/setTxtVal()] : in your Action form class [incase you're using Struts] or else have the getter/setter in your Action class itself [if using Struts2]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic