This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic