I’m trying to display a minor animation to user that it is being submitted.
$("#textscreen").dialog({
modal: true,
draggable: false,
open: function(event, ui) {
$(this).everyTime("1s", function(i) {
var dots = '';
if((i % 4) == 0)
{
dots = '';
}
else
{
dots = dots + ".";
}
$(this).html("<b>"+processText+dots+"</b>");
}, 30);
}
});
That is basically triggered when user clicks the submit button and it is triggered by calling like this:
DisplayModal("Submitting");
Since the button tries to POST on click, I’ve put in return false:
function button_OnClick()
{
DisplayModal("Submitting");
return false;
}
When I click on the button, the modal flashes up and disapears, then POSTs.
Why is the function being posted when I am returning false?
Look here + I recommend you to put the call for ‘DisplayModal’ in try catch