• 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

help in inserting checkbox value into data base

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic