Is there a JS callback that closes and sets cookie on validation?
-
I a using a form provided by a company that does online booking, customer relation management, smart marketing, etc. The form connects to their API and has the following Javascript that validations API connection success:
$(document).ready(function() {
$(“form”).submit(function(e){
var formdata = $(this).serialize();
showLoader();
e.preventDefault(e);
$.ajax({
url: ‘/OpportunityAPI.php’,
type: ‘POST’,
data: formdata,
success: function(msg) {
hideLoader();
$(“#form”)[0].reset();
console.log(msg);
if(msg.includes(“success”)){
alert(‘Opportunity successfully created!’);
}
else
{
alert(‘Something went wrong. Please check the Configuration !’);
}
}
});return false;
});
});Is there a callback where I can replace “alert(‘Opportunity successfully created!’);” with a callback that sets the conversion cookie and closes the popup?
- The topic ‘Is there a JS callback that closes and sets cookie on validation?’ is closed to new replies.