Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

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: 39206
726
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: 67255
170
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.

 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!