• 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

How to fectch the selected index number from dropdown list?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41860
908
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic