"select" have the "selected" attribute r

Codes here !

Moderators: egami, macek, gesf

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

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>

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

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 ?>
best regards,
Elena Mitovska,
AlarIt company

Post Reply