I'm trying to use blockUI but although it passes over with no errors, it doesn't work
the code below is all within the $(document).ready() function
$("#btnSaveJob").click(function () {
if ($("#frmJobDetails").valid()) {
$("#frmJobDetails").submit();
}
});
$("#frmJobDetails").submit(function (e) {
$('#jobDetails').block({
message: 'Saving, please wait...',
centerX: true,
centerY: true,
css: {
width: '600px',
height: '300px',
border: '3px solid #FF9900',
backgroundColor: '#000',
color: '#fff',
padding: '25px'
}
});
submitNew('job');
e.preventDefault();
$('#jobDetails').unblock();
});
edit to add in the submitNew function
function submitNew(submitType) { // various variables set here if (submitType == 'job') { PageMethods.SubmitJobForm(propID, dateReceived, targetResponse, targetComplete, chargeable, jobTypeID, jobTypeText, contractID, contractText, csJobTypeID, csJobTypeText, priorityID, priorityText, status, notes, fnsuccesscallbackJob, fnerrorcallback); } else if (submitType == 'instruction') { PageMethods.SubmitInstruction(fnsuccesscallbackInstruction, fnerrorcallback); } else { } }
have to add this bit in as editor complaining I've added too much code....
unblock()
should be executed when your request is finish and not on submit – MarlynsubmitNew()
function, sounblock()
is executed just after yourblock()
– Marlyn