
Originally Posted by
chrislynch8
Where can I find this check form?
Rgds
Chris
Chris
/include/javascript/sugar_grp1.js
Here is my modified version
As well as doing some other checks it also prevents a problem with IE where if you click save twice you can end up with duplicate records
Code:
function check_form(formname) {
// check time on save
if (document[formname].check_time_flag == undefined) {
} else {
if (check_time('date_start','date_end',formname) == false) return false;
}
if (formname.match(/QuickCreate/)) {
// use original
if(typeof(siw)!='undefined'&&siw&&typeof(siw.selectingSomething)!='undefined'&&siw.selectingSomething)
return false;return validate_form(formname,'');
} else {
if (typeof (siw) != 'undefined' && siw
&& typeof (siw.selectingSomething) != 'undefined'
&& siw.selectingSomething)
return false;
if (validate_form(formname, '')) {
if (document.forms.length > 0) {
for (i = 0; i < document.forms.length; i++) {
for (j = 0; j < document.forms[i].elements.length; j++) {
var field = document.forms[i].elements[j];
if (field.type == "submit") {
if (field.value == "Save") {
// field.style.display = "none";
field.disabled = true
}
}
}
}
}
document[formname].submit()
// return true;
} else {
return false;
}
}
}
Bookmarks