Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Populate form fields from a list of data!

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

I have an HTML form populated with data from the database as pairs of key-description by a Struts Action class. I also have a textbox. I want the key value into the text box when it is clicked.How do I do this?I hope my question is clear...Is JavaScript the only way to do it? b'coz i will be passing the textbox value to a Struts ActionClass for further processing.Any help ASAP would be appreciated.Looking for help!

Thanks,
Prabha
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Your Html form is populated, it means that the textbox is also populated with its value from the database. Do you want to have an onclick event on the textbox?, can you be more clear in explaining your requirement.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have done like this using javascipt only . That is the easiest way to handle.And if you have the entry in the formbean class(your action form class) for your textbox property, you will get the textbox value in your action class. Else you can you request.getParameter("") also to get the value from the text box(you might know this).
My suggestion is it will be better to use javascript .
all the best

poornima
 
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic