• Post Reply Bookmark Topic Watch Topic
  • New Topic

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
Marshal
Posts: 38394
650
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..
 
Author and ninkuma
Marshal
Posts: 66730
167
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.

 
That new kid is a freak. Show him this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!