Foros del Web » Programando para Internet » Jquery »

Enviar datos de un Jquery Tab a PHP

Estas en el tema de Enviar datos de un Jquery Tab a PHP en el foro de Jquery en Foros del Web. Hola. Tengo como 3 semanas leyendo y leyendo pero no se como hacer esto. Tengo un sistema de pestañas realizado en Jquery, son 6 pestañas. ...
  #1 (permalink)  
Antiguo 20/06/2011, 07:23
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Pregunta Enviar datos de un Jquery Tab a PHP

Hola. Tengo como 3 semanas leyendo y leyendo pero no se como hacer esto. Tengo un sistema de pestañas realizado en Jquery, son 6 pestañas. En la primera pestaña el usuario debe introducir información en 8 input text y en cada una de las pestañas siguientes debe seleccionar algunos checkbox para escoger opciones.

Lo que requiero es que al final, en la última pestaña se recolecte todo lo que el usuario escogio y poder enviarlo a una pagina php que lo muestre y lo pueda enviar a un correo.

Yo hice esto leyendo por aqui y por allá:

Código Javascript:
Ver original
  1. function validar(){
  2.       //valores de los inputs
  3.       usuario=document.form1.fecha_evento.value;
  4.       pass=document.form1.tipo_evento.value;
  5.       //instanciamos el objetoAjax
  6.       ajax=objetoAjax();
  7.       //uso del medotod POST
  8.       //archivo que realizará la operacion
  9.       //validar.php
  10.       ajax.open("POST", "detalles.php",true);
  11.       ajax.onreadystatechange=function() {
  12.       if (ajax.readyState==4) {
  13.           if(ajax.responseText=="1")
  14.           {
  15.               redireccionar();
  16.           }
  17.           else
  18.           {
  19.               if(ajax.responseText=="0")
  20.               {
  21.                   alert("DATOS NO VALIDOS");
  22.               }
  23.           }
  24.       //alert("listo");
  25.       }
  26.       };
  27.       ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  28.       //enviando los valores
  29.       ajax.send("Fecha="+fecha_evento+"&Tipo="+tipo_evento);
  30.       }
  31.  
  32. var pagina = 'http://localhost/pagina/cotizacion.php';
  33. function redireccionar() {
  34.     document.location.href=pagina;
  35. }

No se si esto se hace asi.

Tampoco se donde coloco y como (en el html) el boton que procesará esto.

Estoy muy, muy confundida.

Por favor orientenme porque voy a perder mi trabajo.

Gracias.
__________________
Caminando con el corazón partío
  #2 (permalink)  
Antiguo 20/06/2011, 09:20
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Enviar datos de un Jquery Tab a PHP

Segui buscando y como estoy usando JQuery UI consegui algo que empleo de esta manera:

Código Javascript:
Ver original
  1. jQuery.fn.validateTab = function (toTab) {
  2. var isValid = true;
  3. $(this).find("input, select").each(function () {
  4. if (isValid) {
  5. isValid = $(this).valid();
  6. } else {
  7. $(this).valid();
  8. }
  9. });
  10. if (isValid) {
  11. if (!toTab) {
  12. toTab = 0;
  13. }
  14. $("#tabs").tabs('select', toTab);
  15. }
  16. return false;
  17. }
  18.  
  19. $(document).ready(function () {
  20. $('#btnToPhoneNumber').click(function (e) {
  21. e.preventDefault();
  22. $("#EventoTab").validateTab(1);
  23. });
  24. $('#btnToGeneral').click(function (e) {
  25. e.preventDefault();
  26. $("#AtraccTab").validateTab(0);
  27. });
  28. $('#AlimentoTab').click(function (e) {
  29. e.preventDefault();
  30. $("#").validateTab(0);
  31. });
  32.  
  33. $('#FestejosTab').click(function (e) {
  34. e.preventDefault();
  35. $("#").validateTab(0);
  36. });
  37.  
  38. $('#EntretenTab').click(function (e) {
  39. e.preventDefault();
  40. $("#").validateTab(0);
  41. });
  42.  
  43.  
  44. $('#DecorTab').click(function (e) {
  45. e.preventDefault();
  46. $("#").validateTab(0);
  47. });
  48.  
  49. });

Estos son mis tab:

Código HTML:
Ver original
  1. <form id="MultiTabValidation" action="detalles.php" method="post">
  2. <!-- tabs -->
  3.     <ul class="tabs">
  4.         <li><a href="#EventoTab" class="w2 current">Evento</a></li>
  5.         <li><a href="#AtraccTab" class="w2">Atracciones</a></li>
  6.         <li><a href="#AlimentoTab" class="w2">Alimentos/Bebidas</a></li>
  7.         <li><a href="#FestejosTab" class="w2">Serv. Festejos</a></li>
  8.         <li><a href="#EntretenTab" class="w2">Entretenimiento</a></li>
  9.         <li><a href="#DecorTab" class="w2">Decoración</a></li>
  10.     </ul>
  11.  
  12. <!-- panes -->
  13. <div class="panes">
  14. <div style="display: block;">
  15. //aqui varios input text
  16. </div>
  17. <div style="display: block;">
  18. //aqui varios checkbox
  19. </div>
  20. //...etc
  21. </div>

al final coloco el boton que enviará todo a una pagina php:

Código HTML:
Ver original
  1. <button id="btnSubmit" name="btnSubmit" type="button">Submit</button>

EL problema es que no se como enviarlo a este documento y pasar los valores que el usuario ingresó.

Por favor necesito que me ayuden a entender como hago esto.

Gracias
__________________
Caminando con el corazón partío
  #3 (permalink)  
Antiguo 20/06/2011, 15:39
Avatar de livemusic  
Fecha de Ingreso: abril-2011
Ubicación: Lima - Chorrillos
Mensajes: 150
Antigüedad: 13 años
Puntos: 18
Exclamación Respuesta: Enviar datos de un Jquery Tab a PHP

Hola, es muy sencillo lo que buscas realizar de echo te puedo ayudar con solo 2 tip'S, de echo es la manera de como io lo trabajo, y espero y te de resultado..

1--- serialize
2--- ajax

//// HTML form..

Código HTML:
Ver original
  1. <form action="javascript: fn_insert_user_aplication();" method="post" id="frm_user_aplication">
  2. <input name="txtNameUser" type="text" id="txtNameUser" />
  3. </form>


//// JS
Código Javascript:
Ver original
  1. function fn_insert_user_aplication(){
  2.     var str = $("#frm_user_aplication").serialize();
  3.     $.ajax({
  4.         url: 'ajax.php?pag=newUser',
  5.         data: str,
  6.         type: 'post',
  7.         success: function(data){
  8.             if(data != ""){
  9.                 alert(data);
  10.                                                 }else{
  11.                                                                 alert('Ingreso de datos correctamente');
  12.                                                 }
  13.         }
  14.     });
  15. };

//serialize : Obtiene lo valores de todo tu form ia sea de tipo inputs selec hidden y demas...
--->var str = $("#frm_user_aplication").serialize();

// Destino de envio, donde es que lo queremos enviar
--->url: 'ajax.php?pag=newUser'

// Valores enviados...
--->data: str

// Verificamos el envio d data..
--->success: function(data){


///////////////////////////////////////////////////////////////////////////
PHP
$username = $_POST['txtNickName'];


Listo espero haberte ayudado suerte, si hubo algo q no entendiste, comunicate conmigo.... saludos suerte...

Última edición por livemusic; 20/06/2011 a las 15:45
  #4 (permalink)  
Antiguo 20/06/2011, 19:45
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Enviar datos de un Jquery Tab a PHP

Hola livemusic, no te imaginas cuanto te agradezco tu valiosa ayuda. Coloqué el codigo tal como me indicaste y si me almacena los valores pero no me abre la pagina php. No se si es que no está bien el boton submit. Yo lo puse asi:

Código HTML:
Ver original
  1. <input type="submit" value="Cotizar"/>

Esto esta mal???

Es que es primera vez que uso ajax.

Gracias
__________________
Caminando con el corazón partío
  #5 (permalink)  
Antiguo 20/06/2011, 20:02
 
Fecha de Ingreso: junio-2011
Mensajes: 7
Antigüedad: 12 años, 10 meses
Puntos: 0
Respuesta: Enviar datos de un Jquery Tab a PHP

Yo usaría la función .load(); de Jquery
en el PHP que recibe por POST, pondré un code sencillo de ejemplo:
test.php
Código PHP:
Ver original
  1. <?php
  2. echo $_POST['campo'];
  3. ?>
Y usando Jquery(1.6.1 uso yo) y la función load:
archivo.html:
Código Javascript:
Ver original
  1. <script src='http://anycode.s.gp/jquery-1.6.1.js'></script>
  2. <script language='JavaScript'>
  3. $(document).ready(function(){
  4. $('#carga_contenido').load('test.php',{campo:'Test!'});
  5. });
  6. </script>
  7. <div id='carga_contenido'></div>
En load('test.php'... cambias por tu archivo que recibe $_POST
y luego entre {} pones los campos POST : Valor

Saludos.
  #6 (permalink)  
Antiguo 20/06/2011, 20:17
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Enviar datos de un Jquery Tab a PHP

Hola JaAViEr_, muchas gracias pero no me sirve pues incluso no me deja moverme entre las pestañas.

Creo que lo que me indica livemusic es lo que se ajusta al jquery tab que tengo pero no me abre el php. Creo que hay que ponerle un open pero no se como ni donde.

???
__________________
Caminando con el corazón partío
  #7 (permalink)  
Antiguo 20/06/2011, 21:25
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Enviar datos de un Jquery Tab a PHP

Estoy tan desesperada... Ahora lo puse asi y veo que pasa los valores por get pero el problema es que no avanza de pestaña a pestaña y no me lleva al php. Es asi:

Código Javascript:
Ver original
  1. function nuevoAjax(){
  2.     var xmlhttp=false;
  3.       try {
  4.         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5.        } catch (e) {
  6.         try {
  7.          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  8.           } catch (E) {
  9.            xmlhttp = false;
  10.           }
  11.           }
  12.  
  13.            if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  14.               xmlhttp = new XMLHttpRequest();
  15.             }
  16.              return xmlhttp;
  17.              }
  18.  
  19.   function cargarContenido(datasource,divID){
  20.     var contenedor;
  21.     var otro;
  22.     contenedor = document.getElementById('tabs').getElementsByTagName('li');
  23.                        
  24.      ajax=nuevoAjax();
  25.  
  26.       var nombre =document.form.fecha_evento.value //Esta variable obtiene el valor de lo q puso el usuario en el textbox nombre
  27.                         ajax.open("GET", "detalle_cotizacion.php?"+"&"+"nombre="+nombre,true);
  28.                         ajax.onreadystatechange=function() {
  29.                          if (ajax.readyState==4) {
  30.                             contenedor.innerHTML = ajax.responseText
  31.                             }
  32.                         }
  33.                     ajax.send(null)
  34.                     }

y en el boton de la ultima pestaña esto:

Código HTML:
Ver original
  1. <input type="submit" value="Cotizar" onclick ="cargarContenido('detalle_cotizacion.php','contenedor')"/>

ya no se como hacer
__________________
Caminando con el corazón partío
  #8 (permalink)  
Antiguo 20/06/2011, 23:06
Avatar de livemusic  
Fecha de Ingreso: abril-2011
Ubicación: Lima - Chorrillos
Mensajes: 150
Antigüedad: 13 años
Puntos: 18
Respuesta: Enviar datos de un Jquery Tab a PHP

wow, la manera de como... se trabaja AJAX ES DE ESTA FORMA


Código Javascript:
Ver original
  1. $.ajax({
  2.         url: 'ajax.php?pag=newUser',
  3.         data: str,
  4.         type: 'post',
  5.         success: function(data){
  6.             if(data != ""){
  7.                 alert(data);
  8.              }else{
  9.                 alert('Ingreso de datos correctamente');
  10.               }
  11.         }
  12.     });
  #9 (permalink)  
Antiguo 20/06/2011, 23:37
Avatar de livemusic  
Fecha de Ingreso: abril-2011
Ubicación: Lima - Chorrillos
Mensajes: 150
Antigüedad: 13 años
Puntos: 18
Respuesta: Enviar datos de un Jquery Tab a PHP

Mira este ejemplo espero y te ayude :)...

http://articlecon.com/phpdemo/b1/test/wizard
  #10 (permalink)  
Antiguo 21/06/2011, 01:35
Avatar de livemusic  
Fecha de Ingreso: abril-2011
Ubicación: Lima - Chorrillos
Mensajes: 150
Antigüedad: 13 años
Puntos: 18
Respuesta: Enviar datos de un Jquery Tab a PHP

Mira no entiendo como lo estas trabajando pero te recomiendo q lo trabajes de la siguiente forma,, :) espero y te sea de mucha ayuda...

////////HTML

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Documento sin título</title>
  5. <script src="http://www.google.com/jsapi"></script>
  6.     google.load("jquery", "1.6.1");
  7. <script type="text/JavaScript">
  8.  
  9. function fn_insert_user(){
  10.     var str = $("#insert_user").serialize();
  11.     $.ajax({
  12.         url: 'demo.php',
  13.         data: str,
  14.         type: 'post',
  15.         success: function(data){
  16.             $("#show").html(data);
  17.         }
  18.     });
  19. };
  20.  
  21. function wizard(integer){
  22.     $('#myslide .cover').animate({left:-350*(parseInt(integer)-1)})
  23.     $('#button a').each(function(){
  24.     $(this).removeClass('active');
  25.         if($(this).hasClass('button'+integer)){
  26.             $(this).addClass('active')
  27.         }
  28.     });
  29. }
  30.  
  31. $(function(){
  32.     $('#button a').click(function(){
  33.         var integer = $(this).attr('rel');
  34.         wizard(integer);
  35.         return false;
  36.     });
  37. })
  38.  
  39. <style type="text/css">
  40.     #myslide {width:350px;overflow:hidden;position: relative;height:330px;margin-bottom:20px}
  41.     #myslide .cover{width:1400px; position: absolute; height:350px;}
  42.     #myslide .mystuff {width:350px;float:left;margin:20px 0;}
  43.     .button1,.button2,.button3,.button4{background:#999;padding:6px;display:block;float:left;margin-right:5px;}
  44.     .active{background:#111;padding:6px;display:block;float:left;outline:none;}
  45.     .clear{clear:both;}
  46. </head>
  47.  
  48.     <div id="button">
  49.          <a class="button1 active" rel="1" href="#"></a>
  50.          <a class="button2" rel="2" href="#"></a>
  51.          <a class="button3" rel="3" href="#"></a>
  52.          <a class="button4" rel="4" href="#"></a>
  53.     </div>
  54.     <div class="clear"></div>
  55.     <div id="myslide">
  56.         <form action="javascript: fn_insert_user();" id="insert_user">
  57.         <div class="cover">
  58.             <div class="mystuff">
  59.               <label>Ingresar Nombre <input type="text" name="txtNombre" /></label>
  60.             </div>
  61.             <div class="mystuff">
  62.               <label>Ingresar Apellido <input type="text" name="txtApellido" /></label>
  63.             </div>
  64.             <div class="mystuff">
  65.               <label>Ingresar Telefono <input type="text" name="txtTelefono" /></label>
  66.             </div>
  67.             <div class="mystuff">
  68.               <label>Mostrar datos <input type="submit" value="Mostrar datos" /></label>
  69.             </div>
  70.         </div>
  71.         </form>
  72.     </div>
  73.     <div class="clear"></div>
  74.     <div id="show"></div>
  75. </body>
  76. </html>

//////// PHP

Código PHP:
Ver original
  1. <?php
  2.     $nombre   = $_POST['txtNombre'];
  3.     $apellido = $_POST['txtApellido'];
  4.     $telefono = $_POST['txtTelefono'];
  5.    
  6.     echo "$nombre $apellido $telefono\n";
  7.    
  8. ?>


Saludos suerte si ay algo q no te sale me avisas SALUDOS... suerte
  #11 (permalink)  
Antiguo 21/06/2011, 08:46
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Enviar datos de un Jquery Tab a PHP

livemusic gracias por tu apoyo pero sigue sin servirme. asi lo tengo:

Código PHP:
Ver original
  1. <head>
  2. <script src="jquery.tools.min.js"></script>
  3. <link rel="stylesheet" type="text/css" href="standalone.css">  
  4. <link rel="stylesheet" type="text/css" href="tabs.css">
  5.  
  6. <script>
  7. function tab(pestana,wizard)
  8. {
  9.    pst = document.getElementById(pestana);
  10.    pnl = document.getElementById(wizard);
  11.    psts = document.getElementById('tabs').getElementsByTagName('li');
  12.    pnls = document.getElementById('wizard').getElementsByTagName('div');
  13.  
  14. }
  15. </script>
  16.  
  17. <script language="javascript">
  18. function fn_insert_user(){
  19.     var str = $("#insert_user").serialize();
  20.     $.ajax({
  21.         url: 'detalle_cotizacion.php',
  22.         data: str,
  23.         type: 'post',
  24.         success: function(data){
  25.             $("#show").html(data);
  26.         }
  27.     });
  28. };
  29.  
  30. </script>
  31. </head>
  32. <body>
  33.  
  34. <div id="content">
  35. <div id="promotions">
  36. <form action="javascript: fn_insert_user();" id="insert_user">
  37. <div id="wizard">
  38. <!-- tabs -->
  39.     <ul class="tabs">
  40.         <li><a href="#EventoTab" class="w2 current">Evento</a></li>
  41.         <li><a href="#AtraccTab" class="w2">Atracciones</a></li>
  42.         <li><a href="#AlimentoTab" class="w2">Alimentos/Bebidas</a></li>
  43.         <li><a href="#FestejosTab" class="w2">Festejos</a></li>
  44.         <li><a href="#EntretenTab" class="w2">Entretenimiento</a></li>
  45.         <li><a href="#DecorTab" class="w2">Decoración</a></li>
  46.     </ul>
  47.  
  48. <!-- panes -->
  49. <div class="panes">
  50. <div style="display: block;">
  51.   <table width='400'>
  52.   <p></p>  <p></p>
  53.    <tr>
  54.    <td>Fecha:</td>
  55.    <td><input name="fecha_evento" id="fecha_evento" type="text" ></td>
  56.    <td>Tipo:</td>
  57.    <td><input name="tipo_evento" type="text"></td>
  58.    </tr>
  59.    <tr>
  60.    <td>Dirección:</td>
  61.    <td><input name="dir_evento" type="text" id="dir_evento" ></td>
  62.    <td>Lugar:</td>
  63.    <td><input name="carac_lugar" type="text" ></td>
  64.    </tr>
  65.     <tr>
  66.    <td>Hora Inicio:</td>
  67.    <td><input name="hora_ini" type="text" id="hora_ini" ></td>
  68.    <td>Niños:</td>
  69.    <td><input name="ctdad_ninos" type="text" ></td>
  70.    </tr>
  71.     <tr>
  72.    <td>Adultos:</td>
  73.    <td><input name="ctdad_adult" type="text" id="ctdad_adult"></td>
  74.    <td>Generadora Energia:</td>
  75.    <td>
  76.    <label>
  77.    <input type="radio" name="energia" value="si" id="e_0" >si
  78.    <input type="radio" name="energia" value="no" id="e_1" >no
  79.    </label>
  80.    </td>
  81.    </tr>
  82.    </table>
  83.       <p><button class="next">Next »</button></p>
  84. </div>
  85.  
  86. <!-- P1 -->        
  87. <div style="display: block;">
  88. <table width="600">
  89.   <tr>
  90.     <td width="300">
  91.  
  92.  <table width="300">
  93.  <tr>
  94. <td colspan="2"><center>Atracciones</center></td>
  95. </tr>
  96. <?php echo "
  97.  <td width=\"150\">Producto</td>
  98.  <td width=\"100\">Seleccionar</td>  
  99.  </tr>
  100.  <tr>";
  101.     $rs = mysql_query("SELECT * FROM coti where categoria='atracc'");
  102.     while ($result = mysql_fetch_array($rs)) {
  103.     $categoria = $result['categoria'];
  104.     $producto = $result['producto'];
  105. echo
  106. "          
  107.   <td>$producto</td>
  108.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  109.   </tr>"; }?>
  110.     </table>
  111.  
  112. <td width="300"><table width="300">
  113. <tr>
  114. <td colspan="2"><center>Promocionales</center></td>
  115. </tr>
  116. <?php echo
  117. "
  118.  <tr>
  119.  <td width=\"150\">Producto</td>
  120.  <td width=\"100\">Seleccionar</td>  
  121.  </tr>
  122.  <tr>";
  123.     $rs = mysql_query("SELECT * FROM coti where categoria='promo'");
  124.     while ($result = mysql_fetch_array($rs)) {
  125.     $categoria = $result['categoria'];
  126.     $producto = $result['producto'];
  127. echo
  128. "          
  129.   <td>$producto</td>
  130.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  131.   </tr>
  132.  ";
  133. }
  134. ?>
  135.     </table></td></td>
  136.   </tr>
  137. </table>
  138.     <label>
  139.     <p><button class="prev">« Prev</button>
  140.     <button class="next">Next »</button></p>
  141.    </label>
  142. </div>
  143.  
  144. <!-- P2-->                
  145. <div style="display: block;">
  146. <table width="600">
  147.   <tr>
  148.     <td width="300">
  149.  
  150.  <table width="300">
  151.  <tr>
  152. <td colspan="2"><center>Alimentos</center></td>
  153. </tr>
  154. <?php echo "
  155.  <td width=\"150\">Producto</td>
  156.  <td width=\"100\">Seleccionar</td>  
  157.  </tr>
  158.  <tr>";
  159.     $rs = mysql_query("SELECT * FROM coti where categoria='alim'");
  160.     while ($result = mysql_fetch_array($rs)) {
  161.     $categoria = $result['categoria'];
  162.     $producto = $result['producto'];
  163. echo
  164. "          
  165.   <td>$producto</td>
  166.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  167.   </tr>"; }?>
  168.     </table>
  169.  
  170. <td width="300"><table width="300">
  171. <tr>
  172. <td colspan="2"><center>Bebidas</center></td>
  173. </tr>
  174. <?php echo
  175. "
  176.  <tr>
  177.  <td width=\"150\">Producto</td>
  178.  <td width=\"100\">Seleccionar</td>  
  179.  </tr>
  180.  <tr>";
  181.     $rs = mysql_query("SELECT * FROM coti where categoria='beb'");
  182.     while ($result = mysql_fetch_array($rs)) {
  183.     $categoria = $result['categoria'];
  184.     $producto = $result['producto'];
  185. echo
  186. "          
  187.   <td>$producto</td>
  188.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  189.   </tr>
  190.  ";
  191. }
  192. ?>
  193.     </table></td></td>
  194.   </tr>
  195. </table>
  196. <label>
  197.     <p><button class="prev">« Prev</button>
  198.     <button class="next">Next »</button></p>
  199.  
  200.    </label>
  201. </div>
  202.  
  203. <!-- P3 -->                
  204. <div style="display: block;">
  205. <table width="600">
  206.   <tr>
  207.     <td width="300">
  208.  
  209.  <table width="300">
  210.  <tr>
  211. <td colspan="2"><center>Festejos</center></td>
  212. </tr>
  213. <?php echo "
  214.  <td width=\"150\">Producto</td>
  215.  <td width=\"100\">Seleccionar</td>  
  216.  </tr>
  217.  <tr>";
  218.     $rs = mysql_query("SELECT * FROM coti where categoria='fest'");
  219.     while ($result = mysql_fetch_array($rs)) {
  220.     $categoria = $result['categoria'];
  221.     $producto = $result['producto'];
  222. echo
  223. "          
  224.   <td>$producto</td>
  225.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  226.   </tr>"; }?>
  227.     </table>
  228.  
  229. <td width="300"><table width="300">
  230. <tr>
  231. <td colspan="2"><center>Festejos</center></td>
  232. </tr>
  233. <?php echo
  234. "
  235.  <tr>
  236.  <td width=\"150\">Producto</td>
  237.  <td width=\"100\">Seleccionar</td>  
  238.  </tr>
  239.  <tr>";
  240. echo
  241. "          
  242.   <td>$producto</td>
  243.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  244.   </tr>
  245.  ";
  246. }
  247. ?>
  248.     </table></td></td>
  249.   </tr>
  250. </table>
  251. <label>
  252.     <p><button class="prev">« Prev</button>
  253.     <button class="next"  >Next »</button></p>
  254.  
  255.    </label>
  256. </div>
  257.  
  258. <!-- P4 -->                
  259. <div style="display: block;">
  260. <table width="600">
  261.   <tr>
  262.     <td width="300">
  263.   <table width="300">
  264.  <tr>
  265. <td colspan="2"><center>Entretenimiento</center></td>
  266. </tr>
  267. <?php echo "
  268.  <td width=\"150\">Producto</td>
  269.  <td width=\"100\">Seleccionar</td>  
  270.  </tr>
  271.  <tr>";
  272.     $rs = mysql_query("SELECT * FROM coti where categoria='entret'");
  273.     while ($result = mysql_fetch_array($rs)) {
  274.     $categoria = $result['categoria'];
  275.     $producto = $result['producto'];
  276. echo
  277. "          
  278.   <td>$producto</td>
  279.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  280.   </tr>"; }?>
  281.     </table>
  282.  
  283. <td width="300"><table width="300">
  284. <tr>
  285. <td colspan="2"><center>Entretenimiento</center></td>
  286. </tr>
  287. <?php echo
  288. "
  289.  <tr>
  290.  <td width=\"150\">Producto</td>
  291.  <td width=\"100\">Seleccionar</td>  
  292.  </tr>
  293.  <tr>";
  294. echo
  295. "          
  296.   <td>$producto</td>
  297.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  298.   </tr>
  299.  ";
  300. }
  301. ?>
  302.     </table></td></td>
  303.   </tr>
  304. </table>
  305. <label>
  306.     <p><button class="prev">« Prev</button>
  307.     <button class="next" >Next »</button></p>
  308.  
  309.    </label>
  310. </div>
  311.  
  312. <!-- P5 -->                
  313. <div style="display: block;">
  314. <table width="600">
  315.   <tr>
  316.     <td width="300">
  317.  
  318.  <table width="300">
  319.  <tr>
  320. <td colspan="2"><center>Decoración</center></td>
  321. </tr>
  322. <?php echo "
  323.  <td width=\"150\">Producto</td>
  324.  <td width=\"100\">Seleccionar</td>  
  325.  </tr>
  326.  <tr>";
  327.     $rs = mysql_query("SELECT * FROM coti where categoria='decor'");
  328.     while ($result = mysql_fetch_array($rs)) {
  329.     $categoria = $result['categoria'];
  330.     $producto = $result['producto'];
  331. echo
  332. "          
  333.   <td>$producto</td>
  334.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  335.   </tr>"; }?>
  336.     </table>
  337.  
  338. <td width="300"><table width="300">
  339. <tr>
  340. <td colspan="2"><center>Decoración</center></td>
  341. </tr>
  342. <?php echo
  343. "
  344.  <tr>
  345.  <td width=\"150\">Producto</td>
  346.  <td width=\"100\">Seleccionar</td>  
  347.  </tr>
  348.  <tr>";
  349. echo
  350. "          
  351.   <td>$producto</td>
  352.   <td><input name=\"atracc\" type=\"checkbox\" value=\"\"></td>
  353.   </tr>
  354.  ";
  355. }
  356. ?>
  357.     </table></td></td>
  358.   </tr>
  359. </table>
  360. <label>
  361.     <p><button class="prev">« Prev</button>
  362. <input type="submit" value="Cotizar"/>
  363.    </label>
  364. </div>
  365. </div>
  366. </div>
  367. </form>
  368.  
  369. <script>
  370. $(function() {
  371.     // get container for the wizard and initialize its exposing
  372.     var wizard = $("#wizard");
  373.  
  374. // enable exposing on the wizard
  375.     wizard.click(function() {
  376.         $(this).load();
  377.     });
  378.    
  379.     // enable tabs that are contained within the wizard
  380.     $("ul.tabs", wizard).tabs("div.panes > div", function(event, index) {
  381.         /* now we are inside the onBeforeClick event */
  382.     });
  383.  
  384.     // get handle to the tabs API
  385.     var api = $("ul.tabs", wizard).data("tabs");
  386.  
  387.     // "next tab" button
  388.     $("button.next", wizard).click(function() {
  389.         api.next();
  390.     });
  391.  
  392.     // "previous tab" button
  393.     $("button.prev", wizard).click(function() {
  394.         api.prev();
  395.     });
  396.  
  397. });
  398. </script>
  399. </div>
  400. </div>
  401. </div>
  402. </body>
  403. </html>

Será que como lo tengo no funciona lo que me indicaste?
__________________
Caminando con el corazón partío
  #12 (permalink)  
Antiguo 21/06/2011, 11:22
Avatar de livemusic  
Fecha de Ingreso: abril-2011
Ubicación: Lima - Chorrillos
Mensajes: 150
Antigüedad: 13 años
Puntos: 18
Respuesta: Enviar datos de un Jquery Tab a PHP

Haber dime que no te sale para poderte ayudar =P ¡...
  #13 (permalink)  
Antiguo 21/06/2011, 11:47
Avatar de livemusic  
Fecha de Ingreso: abril-2011
Ubicación: Lima - Chorrillos
Mensajes: 150
Antigüedad: 13 años
Puntos: 18
Respuesta: Enviar datos de un Jquery Tab a PHP

Posibles problemas ..

1). Puede q no funcione el Ajax

---- jquerytools : no incluya JQUERY....
--> mirar aqui http://flowplayer.org/tools/download/index.html
// De ser asi mejor trabajalo por separado

----------------------------------------------------------------------------------------------
Código Javascript:
Ver original
  1. <script src="http://www.google.com/jsapi"></script>
  2. <script>
  3.     google.load("jquery", "1.6.1");
  4. </script>
  5. <script src="http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js"></script>

----------------------------------------------------------------------------------------------

2). Que Jquery no reconosca eeeee tus consultas MYSQL..

Para eso usaremos el.... setTimeout

Código Javascript:
Ver original
  1. setTimeout(function(){
  2. $(".a").hide();
  3.  
  4. $(".b").show();
  5.  
  6. },5000);

//////// Esta funcion es muy importante por que detiene por asi decirlo nuestras funciones JS, para que el DOOM termine de cargar ... espero no marearte mi objetivo no es ese, tendrias que testearlos con el FIREBUG para poder saber donde esta el error.

Saludos espero y te funcione....


----------------------------------------------------------------------------------------------

Y POR CIERTO TIENES ERRORES EN PHP

REVISA LAS LINEAS :::

/// NO TIENEN INICIO ....
246 -----> }
300 -----> }
355 -----> }

Última edición por livemusic; 21/06/2011 a las 12:03
  #14 (permalink)  
Antiguo 22/06/2011, 20:40
Avatar de kimmy  
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Enviar datos de un Jquery Tab a PHP

livemusic gracias por tu tiempo para ayudarme a resolver esto, pero creo que debo estudiar muchisimo jquery y ajax porque no entiendo casi nada. Voy a dedicar un tiempo para aprender bien todo esto. Mil gracias ;)
__________________
Caminando con el corazón partío

Etiquetas: ajax, php, tab
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

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 10:58.