mscConfirm("Delete","Are you sure you want to delete this post?",function(){alert("Post deleted");},function(){alert('Cancelled');});
mscConfirm(object) :
mscConfirm({title: 'License',subtitle: 'Do you accept the licese agreement?',// default: ''okText: 'I Agree',// default: OKcancelText: 'I Dont',// default: CanceldismissOverlay: true,// default: false, closes dialog when clicked on overlay.onOk: function(){alert('Awesome.');},onCancel: function(){alert('Sad face :( .');}});
New
Prompt -> Equivalent of JS prompt()
The API for mscPrompt and mscConfirm is same. Just the onOk callback of prompt receives a value parameter entered into the prompt.
mscPrompt(object) :
mscPrompt({title: 'Subscribe',subtitle: 'Enter your email to subscribe to the newsletter.',// default: '',defaultValue: 'email',// default: '', this value will be prefilled in the prompt box okText: 'Subscribe',// default: OKcancelText: 'Cancel',// default: CanceldismissOverlay: true,// default: false, closes dialog when clicked on overlay.placeholder: 'Enter your email',// placeholder value to show in input textboxonOk: function(value){mscAlert(value+" has been subscribed to the newsletter.");},onCancel: function(){mscAlert('Sad face :( .');}});
Alert -> Equivalent of JS alert()
mscAlert(text) :
mscAlert("Hello World.");
Added support for new lines and carriage return in mscAlert()
mscAlert(object) :
mscAlert({title: 'Done',subtitle: 'You have been registered successfully. \n Your reg. ID is 4321',// default: ''okText: 'Close',// default: OK});
I am trying to apply mscConfirm on an anchor tag, where upon click I want to confirm user that if he is sure,
Below is the simple code.
<a class="btn btn-success"
onclick="javascript:return mscConfirm('Are you sure you want to start this application??', function(){return true;
})"
href="any-page.html"
>Start</a>
What what happens, when i click on the link, confirm boxes apears and automatically redirects to the herf, before even I click Yes or No?