I have this function and I want to make the var
category to have the value of the combobox that has the id #ticket_category_clone
What am I doing wrong?
function check () {
var category="#ticket_category_clone";
if (category=="Hardware")
{
SPICEWORKS.utils.addStyle('#ticket_c_hardware_clone{display: none !important;}');
}
}
SPICEWORKS.app.helpdesk.ready(check);
edit
It only alerts if I make the code this way:
function check () {
// var category = document.getElementById('#ticket_c_hardware_clone').value;
var category ="Hardware";
alert(category)
if (category=="Hardware")
{
SPICEWORKS.utils.addStyle('#ticket_c_hardware_clone{display: none !important;}');
}
alert(category)
}
SPICEWORKS.app.helpdesk.ready(check);
like this? http://img12.imageshack.us/img12/8438/semttuloluu.png
and the code:
<select id="ticket_category_clone" name="ticket[category]" hdpp="ticket_category"><option value=""></option>