Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/02/2011, 20:55
johhan16
 
Fecha de Ingreso: junio-2010
Ubicación: Venezuela, Zulia
Mensajes: 686
Antigüedad: 13 años, 9 meses
Puntos: 55
Respuesta: Insert con Ajax

no veo porque no puedes insertar un textarea por medio de GET no hay ningun problema en eso
puedes hacer algo asi

index.php
Código PHP:

<html>
<
head>
<
script type="text/javascript" src="ajax.js"></script>

</head>
<body>
<textarea name="comentario" id="comentario" cols="45" rows="5" onBlur="guardarDatos(this.form.comentario.value)" ></textarea>

<div id="resultado" > </div>
</body>
</html> 
ajax.js
Código HTML:
function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function guardarDatos(comentario){
	
	divResultado1 = document.getElementById('resultado');

		ajax=objetoAjax();

		ajax.open("GET", "guardar.php?comentario="+comentario);
		ajax.onreadystatechange=function() {
			

			if (ajax.readyState==4) {
				//mostrar resultados
				divResultado1.innerHTML = "Datos Guardados";
				
				divResultado1.style.display="block";

			}
		}
		//como hacemos uso del metodo GET
		//colocamos null
		ajax.send(null);
}

ya el archivo guardar.php debes saber hacerlo tu