I'm building a script in Greasemonkey that changes the select tag when clicking on a button. However, the current select has already a onChange
option that changes the subcategory.
Is there a way to make the script run this?
HTML Code:
<select id="incident.category" name="incident.category" style=";width:160px;width:180px" onchange="onChange('incident.category');"><option value="">-- None --</option><option value="request" selected="SELECTED">Request</option><option value="incident">Incident</option><option value="informational">Informational</option></select>
My code:
document.getElementById("incident.category").value = "informational";
document.getElementById("incident.category").focus();
window.setTimeout(function ()
{
document.getElementById("incident.subcategory").value = "informational-informational";
document.getElementById("incident.subcategory").focus();
}, 1000);
the subcategory doesn't appear if the category doesn't fire the onChange
which is what is happening right now.
Any ideas?