liquinas Posted February 27, 2007 Share Posted February 27, 2007 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? Quote Link to comment Share on other sites More sharing options...
Orio Posted February 27, 2007 Share Posted February 27, 2007 If you want to have a radio button selected, you need to add inside it's tag: checked="checked". Do you need help creating the code to check the correct button? Orio. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.