I am new to html and php and want to achieve a drop-down menu from the mysql table and hard-coded too. I have multiple select in my page, One of them is

<select name="tagging">
    <option value="">Choose Tagging</option>
    <option value="Option A">Option A</option>
    <option value="Option B">Option B</option>
    <option value="Option C">Option C</option>
</select>

Problem is now that user can also select "choose tagging" as his tagging but i only want to provide him to chose from available three. I used disable as

<select name="tagging">
    <option value="" disabled="disabled">Choose Tagging</option>
    <option value="Option A">Option A</option>
    <option value="Option B">Option B</option>
    <option value="Option C">Option C</option>
</select>

The default is option a So i want to set "choose tagging" as by default and also want to disable it from selection. What's the right way to do it? Same thing need to be done with other select which will fetch data from mysql. I would appreciate suggestions on this matter

Best Answer


use

<option selected="true" disabled="disabled">Choose Tagging</option>