• 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

Radio Button,Check Boxes

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i see source it has a value but it does not display in form.
reply
    Bookmark Topic Watch Topic
  • New Topic