Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to have checkbox value blank instead of "null"

 
vanan saravanan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a couple of checkbox in my jsp page. Those which are ticked pass their values correctly to the database. Those that are unticked pass a "null" value to the database. I dont want a "null" value but just an empty field. How do i do that.

This is my code

String checkbox1 = request.getParameter("Checkbox1");
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What difference would that make in the logic, Vanan? Either way, you know that the checkbox value is unchecked.

And this post is in the wrong forum!
[ October 14, 2006: Message edited by: Saket Barve ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34835
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vanan,
Just add the logic yourself:
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34835
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Servlets forum for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic