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

drop down list boxes

 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Funny how things seemed to work before I went on vacation, and now that I'm back, they don't....
Anyway, here's a little question I have.
I would like to have a drop down box and a submit button, where the value selected in the box gets sent to a servlet, etc, etc, etc, and I end up with the search results on the screen.
Here's my code:
<form method="POST" action="http://keoki.ncr.pwgsc.gc.ca:8080/servlet/DBInventory5" target="right_frame">
See entire list of:<br>
<select name="tables" value="table">
<option value="envs">environments</option>
<option value="locations">locations</option>
<option value="platforms">platforms</option>
<option value="sft_fnds">software foundations</option>
<option value="owners">owners</option>
</select>
<input type="submit" value="Go">
</form>
Is the part between the <select> and </select> right? I need to send specific values to the servlet, and I'm not sure if you put it in the "value" part or not.
(not sure if this is clear or not, so let me know and I'll try explaining again!)
thanks!
Annette
 
John Wetherbie
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks right but I cheated. I viewed the page source for this topic and your HTML looks like the HTML used to "Hop to" another forum.
John
 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hummm... Well ok, I wonder what could be the problem then?
If I use radio buttons to display all the options that would be in the drop-down list, it works fine. But if I use the list, it's like it's not taking the proper value.
guess I'll keep trying!
Thanks,
Annette
 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, the list is working! I had the name and the value reversed. I wouldn't have guessed that, but I tried it and it worked. Now on to more complicated problems!
can you put a piece of code in your .jsp file that would connect to a database and populate a drop-down box for you? I would like to click on a link in one frame and have a new page display in another frame, but when this new page loads, I need to populate a drop-down list box with records from a table in my database. I have an idea how to do it by putting the code in a servlet, but that wouldn't run immediatly. I'm wondering if there's a way to put in directly in the page.
thanks a million!
Annette
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic