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 :
<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>
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?
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]
<select size="1" name="sq">
<option selected="selected">Select One</option>
<option value="childhoodfriend">Who is your best childhood friend?</option>
<option value="favouritemeal">What is your favorite meal?</option>
<option value="...">What is your favorite hobby?</option>
<option value="...">Who is your favorite teacher?</option>
<option value="...">What is your favorite movie?</option>
</select>
so removing the SELECTED attribute from the "Select One" option and putting it on other option you want (eg. What is your town?)
will make that option as default value.