Reputation: 335
I have an HTML form with list of countries, now in profile I want to make selected country that user selected when registered to site. I'm searhed google but I can't make anything works.
In profile I'm selecting Country Value from MySQL
Upvotes: 0
Views: 156
Reputation: 52
If you want to set select
statically then use this
<form>
<select>
<option value="value" selected="selected">01</option>
<option value="value" >02</option>
</select>
</form>
Or if you want to do dynamically then this may be helpful.
Hope this will work for you ...
Upvotes: 2
Reputation: 944568
Put a selected
attribute in the option you want to be selected.
<option value="foo" selected> bar </option>
Upvotes: 2