Here is what I want to / am trying to do.
There is a form. The form has a submit button. the onMouseDown() event for the submit button is:
<input type='submit' value='Search' name='save' id='save' onmousedown = 'DimOn("test.php", "SearchResultDiv")' />
Now, once the button is clicked I want it to do three things in EXACT order.
1) Dim the page.
2) Perform the Ajax Query, and Populate the search Results.
3) Remove the Dim.
EDIT:
Even tried using the beforeSend, and Complete events in jQuery object
function DimOn(sUrl, sElement)
{
jQueryAjax(sUrl, sElement);
}
function jQueryAjax(sUrl, sElement)
{
$.ajax({
url: sUrl,
type: 'GET',
async: false,
cache: false,
timeout: 1000,
beforeSend: function(){
$('#dim').fadeIn();
},
complete : function(){
$('#dim').fadeOut();
},
error: function(){
return true;
},
success: function(msg){
if (msg != '')
PopulateResponse(msg, sElement, false);
else
PopulateResponse("An Error Has Occured.", sElement, false);
}
});
}
Currently, it will appear to do it like this:
2) Perform the Ajax Query, and Populate the search Results.
2) Dim the page.
3) Remove the Dim.
Where the result populate (takes ten seconds) and the dimmer flashes on and off very quickly.
Please lend me a hand fellow programmers, I am no stranger to this technology, and why I turned async off, to try to get stuff to happen in order, but still NO DICE.
I resolved this issue with this function:
This CSS
and This HTML