Page 1 of 1

making drop down,radio sticky

Posted: Tue Sep 12, 2006 5:28 am
by rami
i am doing this to make text field sticky

Code: Select all

<td width="41%"><b>Enter name</b></td>
            <td width="59%"><input type="text" name="name" size="45" maxlength="45" value="<?php if (isset($_POST['category'])) echo $_POST['category']; ?>" /></td>
but i want my select ,drop down to be sticky as well
how can i do that

and whats about radio and check box


when submisssion is not done text fields get previous values but dropdown ,check box ,radio but loses it

Posted: Tue Sep 12, 2006 6:58 am
by feyd
Dynamically add

Code: Select all

selected="selected"
and

Code: Select all

checked="checked"
for option and radio/checkbox tags respectively.

Re:

Posted: Sun Jun 08, 2008 11:56 pm
by rami
feyd wrote:Dynamically add

Code: Select all

selected="selected"
and

Code: Select all

checked="checked"
for option and radio/checkbox tags respectively.
not quite clear
what does it mean by dynamically any example on it

Re: making drop down,radio sticky

Posted: Mon Jun 09, 2008 12:03 am
by Attilitus
i assume that you have code somewhere that loops through the bits while building the multiple form/checkboxes right? Very basically you want to put a unique variable within the form code for each of the checkboxes <input type=radio $form1_checked /> and then within the script detect whether or not that form ought to be checked. It is ought to be checked assign the variable $form1_checked the value checked="checked"