Ver Mensaje Individual
  #9 (permalink)  
Antiguo 08/01/2008, 12:09
manriquez
 
Fecha de Ingreso: enero-2008
Mensajes: 30
Antigüedad: 16 años, 4 meses
Puntos: 0
Re: Como enviar un array u objeto mediante xajax?

Gracias por la ayuda amigo pr0, pero no me funciona la funcion que me mandaste, te dejo mi codigo con un simple formulario.

Código PHP:
<script type="text/JavaScript" src="prototype.js"
function 
envia_datos(){
   var 
capa = $('micapa'); //esto es equivalente a document.getElementById('id_capa')
   
var nombre = $('nombre').value;
   var 
apellido = $('apellido').value;
   var 
pars 'variable1=' variable1 'variable2=' variable2;
   if (!
capa) return false;
    new 
Ajax.Updater(capa'procesa_datos.php'{
        
method'get',
        
parameterspars
    
});

</script>

<!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>Documento sin t&iacute;tulo</title>
</head>

<body>
<form action="procesa_datos.php" method="get">
<table width="60%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Nombre</td>
    <td><label>
      <input type="text" name="apellido" id="apellido" />
    </label></td>
  </tr>
  <tr>
    <td>Apellido</td>
    <td><label>
      <input type="text" name="textfield2" id="textfield2" />
    </label></td>
  </tr>
  <tr>
    <td><label>
      <input type="submit" name="button" id="button" value="Enviar" onclick="envia_datos()" />
    </label></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
<div id="micapa"></div>
</body>
</html> 
Me podrias corregir por favor.?