Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Miguel Rocha1

tem alguem erro?

Recommended Posts


$(document).ready(function(){

/* The following code is executed once the DOM is loaded */

/* This flag will prevent multiple comment submits: */

var working = false;

/* Listening for the submit event of the form: */

$('#addCommentForm').submit(function(e){

e.preventDefault();

if(working)

return false;

 

working = true;

$('#submit').val('Working..');

$('span.error').remove();

/* Sending the form fileds to submit.php: */

$.post('submit.php',$(this).serialize(),function(msg){

working = false;

$('#submit').val('Submit');

if(msg.status){/*/ If the insert was successful, add the comment/below the last one on the page with a slideDown effect

/*/

$(msg.html).hide().insertBefore('#addCommentContainer').slideDown();

$('#body').val('');

}else {

/*/If there were errors, loop through the/ msg.errors object and display them on the page/*/

$.each(msg.errors,function(k,v){

$('label[for='+k+']').append('<span class="error">'+v+'</span>');

});

}

},'json');

});

});

Compartilhar este post


Link para o post
Compartilhar em outros sites

qual erro aparece? ou não aparece?

Compartilhar este post


Link para o post
Compartilhar em outros sites

ai fica dificil cara..

 

informe se os seguintes alerts aparecerem:

$(document).ready(function(){
   alert( 'jQuery iniciado' );

$.post('submit.php',$(this).serialize(),function(msg){
alert( msg );

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.