• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp - Radio / Checkbox

 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thru jsp page with backend java i am inserting data from a form into the database.The form consists of textfields,radio button and checkbox.Values r inserted properly.
I retrieve the data to modify a single row of fields.All the values in the text field are retrieved.But when it comes to radio button or checkbox they r not clicked as per the value in the database.
Pls help.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rose hegde:
Hi,
Thru jsp page with backend java i am inserting data from a form into the database.The form consists of textfields,radio button and checkbox.Values r inserted properly.
I retrieve the data to modify a single row of fields.All the values in the text field are retrieved.But when it comes to radio button or checkbox they r not clicked as per the value in the database.
Pls help.

rose-
you need to provide more information. saying "But when it comes to radio button or checkbox they r not clicked as per the value in the database. means nothing to us ....
how are you retrieving these values, can you post a code snippet?
 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the jsp page while retrieving for text field i write ...(accessing from database thru java...i have written a function in hava called getleaverecord...)
<input name="txtdays" type="txtdays" id="txtdays" value="<%=leaveHandler.getleaverecord(Integer.parseInt(i),3)%>" >
which works fine...
but for checkbox when i write the same thing
<input type="checkbox" name="credit" value="<%=leaveHandler.getleaverecord(Integer.parseInt(i),5)%>">
it doesnt work....
so now can u help...if u did not get the Q ask me..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic