• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

drop down list boxes

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic