HTML Select problem ?
Posted: Thu Mar 22, 2007 3:05 pm
feyd | Please use
what I'm trying to do is to set the value of the select tag to the option I want out of these 4 options :
i.e.
But this doesnt seem to work the value of the select tag is always equal to the first option which is (Select One) so how can I set the value of the select tag to the option I want?
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm using a html select tag with the following code:
[syntax="html"]<select size="1" name="sq">
<option selected>Select One</option>
<option>Who is your best childhood friend?</option>
<option>What is your favorite meal?</option>
<option>What is your favorite hobby?</option>
<option>Who is your favorite teacher?</option>
<option>What is your favorite movie?</option>
</select> what I'm trying to do is to set the value of the select tag to the option I want out of these 4 options :
i.e.
Code: Select all
<select size="1" name="sq" value="<option> What is your town? </option>" >
<option selected>Select One</option>
<option>What is your father name?</option>
<option>What is your country?</option>
<option>What is your town?</option>
</select>feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]