Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/02/2009, 13:29
martuanez
 
Fecha de Ingreso: julio-2008
Mensajes: 109
Antigüedad: 16 años, 6 meses
Puntos: 0
Respuesta: Como cargar formulario en ajax?

Puse solo esa parte porque me parecio que ahí estaba el error el archivo se ve así:
Código HTML:
<?php require('_drawrating.php'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario de prueba</title>
<script type="text/javascript" language="javascript" src="js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="js/rating.js"></script>
<script type="text/javascript" language="javascript" src="jquery-1.3.min.js"></script>
<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
		<script src="scriptaculous/src/effects.js" type="text/javascript"></script>
				<script type="text/javascript" src="validation.js"></script>
<script language="javascript">
$(document).ready(function() {
    $().ajaxStart(function() {
        $('#loading').show();
        $('#result').hide();
    }).ajaxStop(function() {
        $('#loading').hide();
        $('#result').fadeIn('slow');
    });
    $('#form, #fat, #fo3').submit(function() {
        $.ajax({
            type: 'POST',
            url: $(this).attr('action'),
            data: $(this).serialize(),
            success: function(data) {
                $('#result').html(data);

            }
        })
        
        return false;
    }); 
})  
</script>
<link rel="stylesheet" type="text/css" href="css/rating.css" />


		<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
<!--
.asterisco {
	color: #F00;
}
-->
</style>
</head>

<body>
<div id="contact_form">
<form method="post" action="conexion.php" id="fo3" name="fo3" >
						<fieldset>
							<legend>Votame!</legend>
							
				    <div class="field-label">
								  <label for="field1-t2"><span class="asterisco">(*)</span>Nombre y apellido</label>
								  :</div>
							 <input name="field1-t2" id="field1-t2" class="required validate-alpha" title="Debes poner tu nombre." />						 
							<div class="field-label">
							  <label for="field3"><span class="asterisco">(*)</span>E-mail</label>
							  :</div>
						  <div class="field-widget"><input name="field3" id="field3" class="required validate-email" title="Debes poner tu E-mail." /></div>
							
                            
								<div class="field-label">
								  <label for="field4"><span class="asterisco">(*)</span>Edad</label>
								  :</div>
							  <div class="field-label">
							    <input name="field4" id="field4" class="required validate-number" title="Debes poner tu edad, solo n&uacute;meros." />
						    </div>
                            <br />
							
							<div class="field-label">
							  <label for="field6"><span class="asterisco">(*)</span>Sexo</label>
							  :</div>
						  <select id="field6" name="field6" class="validate-selection" title="Debes poner una opci&oacute;n.">
									<option value="-1" selected="selected">--Seleccione--</option>
                                                          <option value="1">Masculino</option>
                                                          <option value="2">Femenino</option>
                                                       </select>
							<br />
							<div class="field-label">
							  <label for="field7"><span class="asterisco">(*)</span>País</label>
							  :</div>
                                <select id="field7" name="field7" class="validate-selection" title="No has elegido pa&iacute;s">
								<option value="-1" selected="selected">--Seleccione--</option>
                                                          <option value="1">Masculino</option>
                                                          <option value="2">Femenino</option>
                          </select>				
                                                     				
						</fieldset>
						<input type="submit" value="Enviar" name="mysubmit"/> 
                        <input type="button" value="Borrar" onclick="valid2.reset(); return false" />
</form>
</div>
</div>
<div id="result"></div>

<script type="text/javascript">
	var valid2 = new Validation('contact_form', {useTitles:true});
</script>

</body>
</html>