• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Populate form fields from a list of data!

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic