Hi Community,
I am trying to alter the submit function on muti step form and perform custom code through try and catch block.
But even if the code is comes in catch block , the submit function executes.
My code:
$('#Button').click(function (e)
{
e.preventDefault();
try
{
if ($('#hello').val = "true")
{
$('#Button').esubmit();
//Intention error esubmit
// if I use .click function, it goes in a loop, hence tried prevent.default
}
else
{
$('#hello').val("");
//assigning it to null
}
}
catch (exceptionVar)
{
alert("Hello");
}
finally
{
alert("Hello");
}
});
//my code catch the error, alerts hello, but still submits. and got o finally block.
I do not want it to submit. once catch in catch block
any help is apperciated.