re:urgent.....asp and javascript problem..pls help
dear all,
i face a problem in asp where i hav 2 combo box and both combo i load the data from database.
When i choose the 1st combo, the 2nd combo will response to the value that i choose from 1st combo. in this case, i use javascript.
My code is like the below:-
HTML part:
<td style="width:35%">
<select style="width:100%" name="txtDesignationID" onchange="txtDesignationID_onchange(GetIndex(event .srcElement))">
<option value="">Select Designation First</option>
<%if TeamRS.RecordCount > 0 then TeamRS.MoveFirst
do while not TeamRS.EOF%>
<option value="<%=TeamRS("Code_Name")%>"><%Response.Write TeamRS("Code_Name")%></option>
<%TeamRS.MoveNext
loop%>
Javascript part:
function txtDesignationID_OnChange()
{
try{
el = event.srcElement;
if (document.frmasp.txtDesignationID.length > 1)
{
for (var c=0;c<document.frmasp.txtDesignationID.length;c++) {
if (el == document.frmasp.txtDesignationID[c]) {
var Tmp = document.frmasp.txtDesignationID[c].options[document.frmasp.txtDesignationID[c].selectedIndex].value;
if (Tmp != "") {
clear_txtAllocatedStaffID(c);
var url = "select_person.asp?txtDesignationID=" + Tmp + "&selected="+c;
window.open(url,'','toolbar=no location=no directories=no status=no menubar=no scrollbars=yes resizable=yes width=1 height=1 top=1 left=1');
}
}
}
}
} catch (e) {
alert(e);
}
}
</select></td>
This coding work well in IE, how ever when i run it at Firefox (coz i use Machintos) it cannot work. The error it return to me is Javascript Type Error: Event has no properties.
Do anyone have any solution??
Thanks.
|