This function is called from one of two forms on a page. It checks to see if the data in the other form has been changed. If so, and if the user has not clicked on the update button, it asks the user whether or not to update the data. Everything works fine until I try to submit the other form. Then I get a message saying "Object does not support this property or method."
frm is the form that calls the function, url is the next page.
function submitThis(frm, url){
if(document.forms.data.changed.value == "changed"{
var msg = "You have changed the data in this form ";
msg += "but have not clicked the update button.";
msg += "\nIf you want to change it, click OK.";
msg += "\nOtherwise click cancel.";
var response = confirm(msg);
if(response){
document.forms.data.submit(); <== Always fails here
}else {
// User doesn't want to save change
frm.action = url;
frm.submit();
}
}
// Document is unchanged
frm.action = url;
frm.submit();
}
The other two instances of the frmName.submit() in this function work with no problem.
Any help will be greatly appreciated.
Paul
frm is the form that calls the function, url is the next page.
function submitThis(frm, url){
if(document.forms.data.changed.value == "changed"{
var msg = "You have changed the data in this form ";
msg += "but have not clicked the update button.";
msg += "\nIf you want to change it, click OK.";
msg += "\nOtherwise click cancel.";
var response = confirm(msg);
if(response){
document.forms.data.submit(); <== Always fails here
}else {
// User doesn't want to save change
frm.action = url;
frm.submit();
}
}
// Document is unchanged
frm.action = url;
frm.submit();
}
The other two instances of the frmName.submit() in this function work with no problem.
Any help will be greatly appreciated.
Paul