• Post Reply Bookmark Topic Watch Topic
  • New Topic

Assigning values to hidden variables

 
Varshini Priya
Ranch Hand
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi


Can you please let me know how do I pass the value of one field(i.e the input value entered by user for a particular field ) as the value for a hidden field in jsp.


THanks in advance
 
Neeraj Dhiman
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used a java script function for this. Correct me if i am doing this in wrong way.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript is not necessary. Simply use an EL expression (with <c:out> if encoding is needed) to emit the value as the value attribute of the hidden element.

E.g.
 
Neeraj Dhiman
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes this is the better one. thanks Bibeault.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!