Probably you have element or JS object called form
or submit
somewhere, conflicting with the real form.
Most safe way is using document.getElementById:
<select onchange="SubmitForm('orderbyfrm');">
And the JavaScript:
function SubmitForm(formId) {
var oForm = document.getElementById(formId);
if (oForm) {
oForm.submit();
}
else {
alert("DEBUG - could not find element " + formId);
}
}
Further debugging with good old alert.. instead of the alert("DEBUG ...
have this:
var sDebugInfo = "found " + document.forms.length + " forms:
";
for (var i = 0; i < document.forms.length; i++) {
var curForm = document.forms[i];
sDebugInfo += "name: " + curForm.name + ", id: " + curForm.id;
sDebugInfo += "
";
}
alert(sDebugInfo);
Depending on what you get, debug should continue.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…