my dog learned polymorphism*
The moose likes JSP and the fly likes Radio Button,Check Boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Radio Button,Check Boxes" Watch "Radio Button,Check Boxes" New topic
Author

Radio Button,Check Boxes

rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
Using Jsp and java i am inserting records in database through a form consisting of text fields,radio buttons and check boxes.The records r inserted successfully and displayed using jsp page.Now i want to modify a particular record where in i get all the values of the particular record stored in text fields but i dont know how to retrieve the status of radio buttons and check boxes stored in database through jsp.
Pls Help
Mathias Nilsson
Ranch Hand

Joined: Oct 13, 2003
Posts: 107
I don't know you the form looks like when you are adding an item.
But let's say you have a form that looks like this

In the servlet you use request.getParameter to retrive the data entered.
When inserted into a database you normaly have an identity key. That means that a row in the table must be unique to retrive the data.
Here's an example table

// Mathias


SCJP2 , MCP( 70-229 ) , Preparing For SCWDC
rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
for text field value to modify , i get the value when i write in jsp--
<input name="txtlename" type="text" id="txtlenam" value="<%=leaveHandler.getleaverecord(Integer.parseInt(i),1)%>" >
but when i write the same for radio button or check it does not happen...
<input type="checkbox" name="carried" value="<%=leaveHandler.getleaverecord(Integer.parseInt(i),4)%>">
Pls help
Mathias Nilsson
Ranch Hand

Joined: Oct 13, 2003
Posts: 107
Have you viewed the source to see if doesn't have a value?
Right click the browser and select view source. Scroll down to the
checkbox.
If it has a value then it has nothing to do with CHECKED.
rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
When i see source it has a value but it does not display in form.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Radio Button,Check Boxes
 
Similar Threads
Problem in onclick radio and dynamically populated table
wants to configure next and previous buttons for database entry !
unable to run select query in frame
doubt
using radio button in struts