Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to insert value from select tag to database  RSS feed

 
hrishih punekar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using servlet html and css. everything works fine but value selected from select box of html is not reflecting in database. NULL value is going each time into database for select option.



and

html code for select tag is
<select name="categery" >
<option value="Art">Art</option>
<option value="Electronics">Electronics</option>
<option value="Music and Video">Music and Video</option>
<option value="Historical">Historical</option>
<option value="Clothes">Clothes</option>
<option value="Historical">Bikes and Cars</option>
<option value="Historical">Statue</option>
<option value="Historical">Diamonds</option>
</select>
 
Ishan Pandya
Ranch Hand
Posts: 228
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to fill the "categery" in the servlet?
Is "categery" variable null when you insert into DB?
 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you put on purpose several times the same value ("Historical") as value into the select?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't shown us how you are obtaining the value in the servlet from the request parameter.
 
hrishih punekar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ishan Pandya wrote:how to fill the "categery" in the servlet?
Is "categery" variable null when you insert into DB?


no I select it from dropdown list. But it is inserted as null in DB.
 
hrishih punekar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ivan Jozsef Balazs wrote:Do you put on purpose several times the same value ("Historical") as value into the select?

no..Sorry it was my mistake.
 
hrishih punekar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You haven't shown us how you are obtaining the value in the servlet from the request parameter.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your spelling.
 
hrishih punekar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Check your spelling.

Thank you..its working now.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!