The function below is called from a onchange event from a different dropdownbox. The loadschedules function populates a schedules dropdownbox. Ultimately, a few other drop down selections are made, the form submits back to itself and all the previous selections are highlighted in their dropdown lists except for the one populated by this function. The value submitted from this dropdownlist is
"ScheduleID" as its name is ="ScheduleID".
How can I modify this function so it selects the correct item based on the value submitted
example": request.form("ScheduleID") 7923
or as passed ScheduleID=7923
the option value is: oNewOpt.value = aScheduleID[x]
somthing like
If oNewOpt.value = aScheduleID[x] == request.form("sheduleid") then
Item is Selected
End if
I'm not very fluent at JS
Thanks
"ScheduleID" as its name is ="ScheduleID".
How can I modify this function so it selects the correct item based on the value submitted
example": request.form("ScheduleID") 7923
or as passed ScheduleID=7923
the option value is: oNewOpt.value = aScheduleID[x]
somthing like
If oNewOpt.value = aScheduleID[x] == request.form("sheduleid") then
Item is Selected
End if
I'm not very fluent at JS
Thanks
Code:
function LoadSchedules(){
var x;
var oNewOpt;
while (document.getElementById("ScheduleID").length >0){
frm.ScheduleID.remove(frm.ScheduleID.length-1);
}
oNewOpt = document.createElement('OPTION');
oNewOpt.text = "<All Schedules>";
oNewOpt.value = 0;
frm.ScheduleID.add(oNewOpt);
for (x=0; x < aSchedules.length; x++){
if (frm.evalid.options[frm.evalid.selectedIndex].value == aSchedEvalID[x]){
oNewOpt = document.createElement('OPTION');
oNewOpt.text = aSchedules[x];
oNewOpt.value = aScheduleID[x];
frm.ScheduleID.add(oNewOpt);
}
}
}