html code :
<section class="main">
<form class="form-4" name="form4" id="form4" method="POST">
<p class="submit">
<button type="submit" name="submit" onclick="show()"><i class="icon-thumbs-up icon-large"></i></button>
</p>
</form>
</section>
js code :
function show(){
$.ajax({
type: "POST",
url: "check_login_points.php",
data: {test : JSON.stringify(arr)},
success: function(data) {
if(data == 0)
{
alert(" SORRY :( \n misplaced cue points.");
}
else if(data == 1)
{
document.getElementById("form4").action = "http://localhost/profile_book/login_key.php";
//alert("WELCOME !!!");
//$("#form4").attr('action', 'http://localhost/profile_book/login_key.php');
}
else if(data == 2)
{
alert("enter cue-points");
}
}
});
}
I am attempting to set the form action in JavaScript after a successful ajax call, but unfortunately, it doesn't seem to be working as expected. Any suggestions or solutions would be greatly appreciated. Thank you in advance!