Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help in inserting checkbox value into data base  RSS feed

 
khan akram khan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello to all,
i m new to jsp and i m trying to create a online test application which consist of 30 question which are checkboxes and every question is having 6 option and every question is having multiple answers i have created the application n successfully inserting also but when i have not select checkbox in any question it should insert zero its also happening but ,if i have select the first question and left the second option and selected the third option now it should insert as the values but it inserting 110 and i m retrieving this question dynamically
here is my code


here my inserting code



please help me thanks in advance
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are new to JSP, learn good habits from beginning, one of them is to not use any scriplets in JSP, its been discredited for 10 years now. Move the Java code to servlets and post here your errors/doubts if any.
 
khan akram khan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k sir that is correct logic of inserting 0 if its null i will take this code to servlet and i want to learn jsp any more suggestion i m final year student of engineering please help and why its changing the order of the insertion can you tell me please .thanks sir
 
Saurabh Pillai
Ranch Hand
Posts: 529
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Along with separating Java code into Servlet from JSP , please indent your code. Right now it is hard for me to read your code.

Welcome to JavaRanch
 
khan akram khan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir ,actually the think i have to do in jsp that's the think because my lab faculty had given this task to me please help me sir why its going in wrong way into database please help saurabh sir ,thanks again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!