Forums Register Login

how to assign values from variables to form

+Pie Number of slices to send: Send
I want to assign values from varibles to textbox or any form control.
Suggest me jsp code
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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}">
And then the flying monkeys attacked. My only defense was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1176 times.
Similar Threads
how to give assign values to form elements with out refreashing the page?
Populating Struts Form on JSP init() or onload()
Pass Array from servlet program to JavaScript
Passing values from child to parent window
Refreshing/Reloading JSPs when user hits Back button
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:40:00.