I have the following bit of Javascript:
function select(id, evt) {
var e = (typeof evt != 'undefined') ? evt : event;
e.cancelBubble = true;
alert('err');
var $toggler = $("#building"+id);
if(!$toggler.is(':checked')){
$toggler.attr('checked', true);
$("#row"+id).removeClass("selectRow");
$("#row"+id).addClass("selectRow");
}
}
I have the following <HTML> block
<td>
<select onchange="select(2, event);" name="prefferedAgent396" class="input-small">
<option value="0">Choose...</option>
<option value="1" selected=""> Senthil </option>
<option value="3"> Sunmeet </option>
<option value="4"> Doesnot Speak English </option>
<option value="5"> Marcus Fava </option>
</select>
</td>
<td>
<input type="text" onchange="select(2, event);" class="input-mini" id="initial396" name="initial396" value="">
</td>
Now the problem is the onchange event triggers the select(2, event) for the select control but not the input control. When i tried an alert box where I call select() it worked but its not simply calling the select(). I have tried onKeyUp but it gave a strange behavior of replacing the text as I type. What am I doing wrong here?