Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to assign values from variables to form

 
Rashmi Chawdhari
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to assign values from varibles to textbox or any form control.
Suggest me jsp code
 
nir sharma
Ranch Hand
Posts: 72
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This site is to help you with your code and other related issues, not to give you THE code.
Search the same thing on google and write something on your own, if you face any trouble then post your code and we will help you out.
 
Dipakpsd Kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
write a javascript function like:

fun(){
document.getElementById('textboxId').value = "abc" //<your value here may be string>
}

and call this function where you want.
Or you can give your textbox name as similar to the variable you are using in your action class or using in the bean.

To know more post your more details.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dipakpsd Kumar wrote:write a javascript function like:

JavaScript is not necessary.

Simply assign the value to the element with the element's value attribute. E.g. <input type="text" value="${someValue}">
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic