So im trying to get the ID of an option from my select tags.
<select id="category" onchange="category_change()">
<option id="0">Please Select A Category</option>
<option id="createnew">Add New Category</option>
</select>
I seem to be able to get whats inside the option tag, but not the actual id :(
the reason i want this value is so i can test to see if they have select the "createnew" option, so i can then display an extra input box so they can add a new category.
Question
mikeaag
Hey,
So im trying to get the ID of an option from my select tags.
<select id="category" onchange="category_change()"> <option id="0">Please Select A Category</option> <option id="createnew">Add New Category</option> </select>I seem to be able to get whats inside the option tag, but not the actual id :(
the reason i want this value is so i can test to see if they have select the "createnew" option, so i can then display an extra input box so they can add a new category.
any ideas?
Thanks in advance
Link to comment
Share on other sites
3 answers to this question
Recommended Posts