Jump to content

Record edit page and radio buttons


liquinas

Recommended Posts

I have a form to edit items from the database it consists of admin.php which puts in values from the database to be displayed in form fields. Then there is process.php which redisplays the form if user left something empty but uses $_POST variables to redisplay what the user just entered instead displaying from database.

 

Sample of field "Color" from form:

 

<input name=\"Color\" type=\"text\" size=\"30\" maxlength=\"10\" value=\"{$carinfo ['Color']}\"/>

That works just fine.

 

On the same page I have fields to select a path for pictures. But with radio buttons. It goes as so:

 <tr>
        <td width=\"13%\"><input name=\"Pic_1\" type=\"radio\" value=\"nopic2.jpg\"/></td>
        <td width=\"87%\">Use default system image </td>
      </tr>
      <tr>
        <td><input name=\"Pic_1\" type=\"radio\" value=\"pictures/{$carinfo ['ID']}_p_1.jpg\" /></td>
        <td>Use image file: /pictures/{$carinfo ['ID']}_p_1.jpg</td>
      </tr>

For all intended purposes it works, except when the user forgets to input something above, like Color, then all radio buttons switch to blank on the re-display of the form.

 

Any way around this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.