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");
}
}
});
}
Am trying to put form action in javascript when an ajax function succeeds. But the form action doesn't seem to work. Suggestions are highly appreciated. Thanks in advance !