File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes how to assign values from variables to form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to assign values from variables to form " Watch "how to assign values from variables to form " New topic

how to assign values from variables to form

Rashmi Chawdhari

Joined: Oct 08, 2012
Posts: 3
I want to assign values from varibles to textbox or any form control.
Suggest me jsp code
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

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

Joined: Dec 08, 2011
Posts: 5
write a javascript function like:

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

Joined: Jan 10, 2002
Posts: 63865

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}">

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: how to assign values from variables to form
It's not a secret anymore!