Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/08/2009, 12:42
alvarols
 
Fecha de Ingreso: diciembre-2008
Mensajes: 738
Antigüedad: 15 años, 5 meses
Puntos: 15
Respuesta: Porque el correo no se manda (cuando la misma validación dice que sí).

cform.js

Código:
// JavaScript Document

<!--  
// When DOM is ready
$(document).ready(function(){

// ------- Submit First Form -------

$("#contact").submit(function(){

var str = $(this).serialize();

   $.ajax({
   type: "POST",
   url: "contact.php",
   data: str,
   success: function(msg){
    
$("#note").ajaxComplete(function(event, request, settings){

if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Tu mensaje se ha enviado, te reponderemos lo mas pronto posible. </div>';
$("#fields").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

// ------- Submit Second Form -------

$("#feedback").submit(function() {

var str = $(this).serialize();

   $.ajax({
   type: "POST",
   url: "feedback.php",
   data: str,
   success: function(msg){
    
$("#note-two").ajaxComplete(function(event, request, settings){

if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Tu mensaje se ha enviado, te reponderemos lo mas pronto posible. </div>';
$("#fields-two").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

});
-->
index.php (donde está el formulario). Solo agrego el formulario y los llamados a Javascript porque lo demás no tiene relevancia ponerlo.

Código:
<script type="text/javascript" src="cform.js"></script>
<script src='js/jquery-1.3.2.min.js' type='text/javascript'></script>

<div id="fields">
          
<h2><form id="contact" name="form" action="javascript:alert('success!');">
<label>Nombre</label><INPUT class="textbox" type="text" name="name" value=""><br />

<label>E-Mail</label><INPUT class="textbox" type="text" name="email" value=""><br />

<label>Asunto</label><INPUT class="textbox" type="text" name="subject" value=""><br />

<label>Comentarios</label><TEXTAREA class="textbox" NAME="message" ROWS="5" COLS="25"></TEXTAREA><br />

<label>&nbsp;</label><INPUT id="submit" class="button" type="submit" name="submit" value="Enviar Mensaje"><div id="loading"></div><span id="dots"></span>
</form></h2>

		<br /><br />
	<br /><br />
			</div>