jAlert("There is an error", "error", function() {
Do some thing afteruser click on OK
.....
Some code behind
});
Thank you Jakub for your answer and i am sorry i did not clarify my situation well enough. In real, i got the below code logic to validate the inputed data on keypress event.
if(config.maxlength compare to $(this).val().length){
jAlert("There is an error");
$(this).focus();
event.stopPropagation();
return;
}
$hidden.attr('value', $(this).val());
As the above content, the jAlert did not wait for user to click on OK button and just call [$(this).focus();], so the cursor is in the parent control and user can not click on OK button on the box.
If i use the default alert box in this case, it will wait user click on OK button then focus back to the validating control
As i am customizing an old system, so behind $hidden.attr('value', $(this).val()); i got a lot of other logic and sub-logic. If i have to use if condition like that, i think i could not control all the source code. So i wonder if existing a solution for this?