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>
But now "Option A" became the default one. So i want to set "Choose Tagging" as by default and also want to disable it from selection. Is it a way to do this. Same thing need to be done with other select which will fetch data from Mysql. Any suggestion will be appreciable.
Electron + React Let your two first options be like this
First to display when closed Second to display first when the list opens
use
If you are using jQuery to fill your select element, you can use this:
html
js
This will allow the user to see the first option as a disabled heading ('Choose Tagging'), and select all other options.
You can set which option is selected by default like this:
I would suggest using javascript and JQuery to observe for click event and disable the first option after another has been selected: First, give the element an ID like so:
and the option an id :
then:
Then you just create the function:
I have a drop down that displays --Select Options-- by default. However, once the option was selected and a mouse click button pressed, the selected option would continue to remain instead of resetting to the default ---select options--- which i needed after the button click event. Following is the sample code for reference :-
<