Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2012, 17:59
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Duda con ajax

hola amigos porque al dar click sobre el boton enviar porque no aparece el alert con los datos enviados?
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {

$('#create_account').click(function(){

//var dataString = $('#form_account').serialize();


var arrayOpt = new Array;
$('input[type=checkbox]').each(function() {
if ($(this).attr('name') == 'opcion[]') {
if ($(this).attr('checked') == 'checked') {
arrayOpt.push($(this).val());
} else{
arrayOpt.push($(this).val()==0);

}
}
});

var noma= $("#nombre").val();
var corra= $("#correo").val();
var telea= $("#telefono").val();



param="nom="+noma+"&corr="+corra+"&boletines="+arr ayOpt+"&tele="+telea;


$.ajax({
type: "POST",
url: "archivo.php",
data: param,
success: function(data) {
alert(data);

}
});
});
});

</script>

</head>
<body>
<form id="form_account" method="post">
Nombre: <input type="text" name="nombre" id="nombre" /><br/><br/>
Email: <input type="text" name="correo" id="correo" /><br/><br/>
Telefono : <input type="text" name="telefono" id="telefono" /><br/><br/>
boletines 1 :<input class="chk" type="checkbox" name="opcion[]" value="1" /><br/><br/>
boletines 2 :<input name="opcion[]" type="checkbox" class="chk" id="opcion[]" value="2" /><br/><br/>
boletines 3 :<input name="opcion[]" type="checkbox" class="chk" id="opcion[]" value="3" /><br/><br/>
<input type="submit" name="enviar" value="Enviar" id="create_account" />

</form>
</body>
</html>