| Author |
Automatically populating a Textbox on the basis of the value of another one.
|
vishnu vyasan
Ranch Hand
Joined: May 27, 2008
Posts: 39
|
|
Hi guys,
As the title says how can i populate a textbox based on the value of another in the same form.
is there any other approches apart from using ajax? can we do this in plain JSP?
Best Regards
Vishnu NV
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
vishnu vyasan wrote:As the title says how can i populate a textbox based on the value of another in the same form.can we do this in plain JSP?
Ajax use to communicate with the server (may be getting some data from server as well). If you want to populate text box from another textbox's value in the form in the JSP you can use a simple Javascript to do that (with using an event). Is this what you want?
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
Keerthi Sagar
Greenhorn
Joined: Apr 21, 2007
Posts: 28
|
|
vishnu vyasan wrote:Hi guys,
As the title says how can i populate a textbox based on the value of another in the same form.
is there any other approches apart from using ajax? can we do this in plain JSP?
Best Regards
Vishnu NV
Hi Vishnu,
Your wording 'Populating' confusing me. Do you wish to create a new text box or you just want to assign some value to it.
If you want to create a new text box, as Vijitha said, you can use simple Javascript for that using document.createElement() function. Google the net for examples on dynamically creating elements using DOM.
|
Thanks and Regards,<br />Y. Keerthi Sagar.
|
 |
vishnu vyasan
Ranch Hand
Joined: May 27, 2008
Posts: 39
|
|
I wanted to hit the server and populate the 2nd text box with the value retrieved from DB.
I got the solution by using Ajax.
any way thanks a lot for quick reply
|
 |
 |
|
|
subject: Automatically populating a Textbox on the basis of the value of another one.
|
|
|