radio button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sejal17
    New Member
    • Dec 2007
    • 56

    #1

    radio button

    hello
    I want to select radio button with the database value.

    i have three radio button:
    <input type='radio' name='method' value='Paypal' checked='check' >Paypal
    <input type='radio' name='method' value='Creditca rd'>Credit Card
    <input type='radio' name='method' value='Paypalmo bile'>Paypal Mobile

    i have inserted that vaue in database as it is selected or checked.noe when i edit my form i want to that the radio button is selected automatically as per the database value.

    help me,please


    thanks in advance.....
  • gnawz
    New Member
    • Nov 2006
    • 64

    #2
    Hi

    You will have to make the radio button dynamic ie connect it to the database.
    You have to create these three radio button fileds in the database either in one of the tables or in their won table.

    I hope this is a good start

    Comment

    • coolsti
      Contributor
      • Mar 2008
      • 310

      #3
      You need to do some PHP programming here. In your HTML, in the three lines for radio buttons, you have the string "checked='check '" in the line which is to be shown as checked when the user makes a page request. This string has to be placed in the correct radio button line according to the results of a database query.

      So your script will do the following on a page request where these radio buttons are to be shown:

      1) Query database to see which radio box is to be shown as selected
      2) Produce the HTML for the radio boxes, placing the string "checked='check '" in the appropriate radio button line, according to the results of 1) above.

      Comment

      Working...