I'm trying to use the jQuery alerts dialog library from http://abeautifulsite.net/notebook/87 instead of the default alerts (which look pretty awful in my opinion). This seems to be a great library, but there is not an example of how to use the jConfirm library.
I need to do something like this:
function confirm() {
var result = false;
var response = false;
jConfirm('are you sure?', 'Confirmation Dialog',
function(r) {
result = r;
response = true;
return r;
});
if (response == true) {
alert(result);
return result;
}
else {
//wait for response
alert('hi');
}
}
and my call from my .net button:
I've posted a comment on the plugin's website (just this morning) and did Google searches for javascript and waiting for a callback to complete with no results.
Any ideas on how to use the callback correctly to get the result, before the rest of the javascript executes?
Thanks.
I think I have come up with a possible solution to this problem. I was reading this article: http://treasure4developer.wordpress.com/2008/06/23/calling-postback-event-from-javascript/
Basically the idea is that you force the postback from javascript, at first I found that the postback would work but wouldn't call my button event, but after reading the article I found that I could detect if it was javascript postback and just call a method to do the processing
Regards DotnetShadow
I would assume you'd have to grab the response like this. I don't think you need a callback.
How the dudes said, there is no way! but... how we use to say in my country (Brazil), le gambi:
we can do something like it:
and the javascript:
it's the same problem but using jquery-ui.
Bye and I hope this can help somebody.