Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

"select" have the "selected" attribute r

Codes here !

Moderators: macek, egami, gesf

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 ?>
Elena Mitovska
New php-forum User
New php-forum User
 
Posts: 13
Joined: Tue Nov 12, 2002 12:11 pm
Location: Ukraine

Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.