This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically updaing JSP Form

 
Vinay
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
In the following situation your help is highly appreciated.
A form contains various select fields. Depending on users login first <select> is populated. When user selets any value in the first <select>, second <select> is populated. And third <select> is populated based on second <select>. All these values are dynamic i.e. coming from DB. I dont' want to submit the form every time user selects value. Is there any way using javascript I can handle this.
Thanking you all in anticipation.
kind regards,
Vinay
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, you could load up the page with all the possible values in Javascript variables, and when various select options are selected, use Javascript to modify the options of the other select elements.
However, this entails you uploading all the possible values with every page load. This may not be practical.
If you need to go back to the server for the data, but don't want the page to refresh, one trick could be to post the server hits to an invisible iframe whose response can contain Javascript that can modify the select elements as appropriate.
hth,
bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic