Send Form and Redirection
i have this code , the form using jquery works fine , but i want if the response of ajax when send form it´s yes redirect and no works , i put here the code i hope some help about this , thanks for all
<script>
$(document).ready(function(){
$('#button').click(function() {
$.ajax({
type: "POST",
url: "result.php",
data:$("#form1").serialize(),
success: function(respuesta) {
/// Don´t Work when call other page in php the response it´s yes ///
switch ($("form").index(this)) {
case 0 :
value = $("#resultado").data("yes");
document.location='secure.php';
break;
}
////
$('#resultado').html(respuesta);
}
});
return false;
});
});
</script>
<div id="resultado"></div>
<form id="form1" name="form1" method="post" action="result.php">
<label>Id_socio
<input type="text" name="socio" id="socio" />
</label> <label class="error" for="socio" id="socio_error">No ha ingresado un socio.</label>
<label>
<input type="submit" name="button" id="button" value="Enviar" />
</label>
</form>
Thank´s For all :)