Foros del Web » Programando para Internet » Javascript » Frameworks JS »

me pueden ayudar a arreglar este codigo

Estas en el tema de me pueden ayudar a arreglar este codigo en el foro de Frameworks JS en Foros del Web. Hola amigos!! tebgo un problema y a lo mejor ustedes pueden ayudarme:necesito que el imput name se envie con la informacion a la pàgina que ...
  #1 (permalink)  
Antiguo 27/07/2011, 18:41
Avatar de saraivaruas  
Fecha de Ingreso: octubre-2010
Ubicación: Chile
Mensajes: 133
Antigüedad: 13 años, 6 meses
Puntos: 10
me pueden ayudar a arreglar este codigo

Hola amigos!! tebgo un problema y a lo mejor ustedes pueden ayudarme:necesito que el imput name se envie con la informacion a la pàgina que procesa y inserta en la base de datos la info ingresada por el usuario
alguien me puede dar una mano?
saludos!!

var comment = '<div class="waveComment addComment">\
\
<div class="comment">\
<div class="commentAvatar">\
<img src="img/Visita.png" width="30" height="30" />\
</div>\
\
<div class="commentText">\
\
<input name="nombre" type="text" value="Escriva su nombre" size="20"/>\
<textarea class="textArea" rows="2" cols="70" name="" />\
<div><input type="button" class="waveButton" value="Enviar" onclick="addSubmit(this,'+parent+')" /> o <a href="" onclick="cancelAdd(this);return false">cancelar</a></div>\
\
</div>\
</div>\
\
</div>';

$el.append(comment);

// Append the form
}

function cancelAdd(el)
{
$(el).closest('.waveComment').remove();
}

function addSubmit(el,parent)
{
/* Executed when clicking the submit button */

var cText = $(el).closest('.commentText');
var text = cText.find('textarea').val();
var wC = $(el).closest('.waveComment');

if(text.length<4)
{
alert("Your comment is too short!");
return false;
}

$(el).parent().html('<img src="img/ajax_load.gif" width="16" height="16" />');
// Showing the loading gif animation

// Send an AJAX request:
$.ajax({
type: "POST",
url: "ajax/saveComment.php",
data: "comment="+encodeURIComponent(text)+"&parent="+par ent,
/* Sending both the text and the parent of the comment */
success: function(msg){

/* PHP returns the automatically assigned ID of the new comment */
var ins_id = parseInt(msg);
if(ins_id)
{
wC.addClass('com-'+ins_id);
addHistory({id:ins_id});
$('#slider').slider('option', 'max', totHistory).slider('option','value',totHistory);
lastVal=totHistory;
}

transForm(text,cText);
// Hiding the form and showing the comment

}
});

}

function transForm(text,cText)
{
var tmpStr ='<span class="name">Visita:</span> '+text;
cText.html(tmpStr);
}

Etiquetas: ajax, arreglar, php, post
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:03.