This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

How to fectch the selected index number from dropdown list?  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have fetched 2nd and 3rd columns from database in view in the list.




Now I want to store the selected index number in a database table.. How will i Get the selected Index Number???
 
author & internet detective
Posts: 38925
686
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to include a value attribute in your options. That way, when the form gets submitted, you have something there.

Also, note that it is poor practice to put Java code in the HTML. Especially database code.
 
Mayukh Singha Roy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:You want to include a value attribute in your options. That way, when the form gets submitted, you have something there.

Also, note that it is poor practice to put Java code in the HTML. Especially database code.



I know, I wrote like this so that the people seeing it can understand it better.. If help me with the solution i will be happier..
 
Marshal
Posts: 67165
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:
Also, note that it is poor practice to put Java code in the HTML. Especially database code.


Mayukh Singha Roy wrote:I know, I wrote like this so that the people seeing it can understand it better..


It'd be best not to do that. Showing us the code in its real setting avoids side-tracks such as this.

Mayukh Singha Roy wrote: If help me with the solution i will be happier



Jeanne already gave you the solution:

Jeanne Boyarsky wrote:You want to include a value attribute in your options. That way, when the form gets submitted, you have something there.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!