"select" have the "selected" attribute r

Codes here !

Moderators: macek, egami, gesf

Elena Mitovska
New php-forum User
New php-forum User
Posts: 13
Joined: Tue Nov 12, 2002 12:11 pm
Location: Ukraine
Contact:

Postby Elena Mitovska » Thu Dec 12, 2002 11:18 pm

In situaiton as yuors I used Javascript. I can not say that my solution is the best, but for me it worked. ALl you have to is to add script in the end of file:
Here is example:
----------------------------------------------------
<select name="sel" id="sel">
<option value=Male>Male</option>
<option value=Female>Female</option>
</select>

<script language="Javascript">
document.all["sel"].value='<?echo $sel?>';
</script>

Where $sel gets value "Male" or "Female" and depending on this value particular optiion will be selected.
---------------------------------------------------------

so you make the same for every of your selects:
document.all["select_id"].value=<?echo $selected_value_taken_from yuor_query ?>

Return to “mySQL & php coding”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests