Sweet alert for Onsubmit client Script

Sindhu M
Tera Expert

Hi,

I am trying to display alert using swal onsubmit client script. I tried the below code. But the issue is, it popup the message and stayed for 10 to 15 seconds and disappears.

function onSubmit() {
swal({
title: 'Message',
html: true,
width:'100px',
text: 'Please: <a href = "www.google.com" target="_blank">Click here</a>',

});

}

So, I modified the code as below which doesn't submit at all even 'OK' is clicked

function onSubmit() {
swal({
title: 'Message',
html: true,
width:'100px',
text: 'Please: <a href = "www.google.com" target="_blank">Click here</a>',

},function(){
});

}

I am looking for something alert stays up until 'OK' is clicked and submit the form.

Did anyone try this before? Please let me know

9 REPLIES 9

Saai1
Tera Expert

Hi Sindhu,

Try this.

function onSubmit() {
swal({
title: 'Message',
html: true,
width:'100px',
text: 'Please: <a href = "www.google.com" target="_blank">Click here</a>',

confirmButtonText : 'OK',

});

}

 

Saai1
Tera Expert

function onSubmit() {
swal({
title: 'Message',
html: true,
width:'100px',
text: 'Please: <a href = "www.google.com" target="_blank">Click here</a>',

confirmButtonText: 'OK',

});

}

 

Saai1
Tera Expert

Hi Sindhu,

Try this:

 

function onSubmit() {
swal({
title: 'Message',
html: true,
width:'100px',
text: 'Please: <a href = "www.google.com" target="_blank">Click here</a>',

confirmButtonText: 'OK',

});

}

 

Saai1
Tera Expert

Hi Sindhu,

 

Try this:

function onSubmit() {
swal({
title: 'Message',
html: true,
width:'100px',
text: 'Please: <a href = "www.google.com" target="_blank">Click here</a>',

confirmButtonText: 'OK',

});

}