Foros del Web » Programando para Internet » Jquery »

Formulario mootools+jquery, añadir datepicker??

Estas en el tema de Formulario mootools+jquery, añadir datepicker?? en el foro de Jquery en Foros del Web. Hola! Me surge la siguiente duda: Tengo un formulario creado con mootools y jquery. El caso, esque a ese formulario me gustaría añadirle un calendario ...
  #1 (permalink)  
Antiguo 20/08/2010, 11:17
Avatar de NaRanJiTo78  
Fecha de Ingreso: noviembre-2007
Ubicación: In the BeaCh
Mensajes: 874
Antigüedad: 16 años, 5 meses
Puntos: 10
Exclamación Formulario mootools+jquery, añadir datepicker??

Hola!

Me surge la siguiente duda:

Tengo un formulario creado con mootools y jquery.

El caso, esque a ese formulario me gustaría añadirle un calendario de datepicker, pero cuando lo integro en el formulario, al señalar la fecha con el ratón, y pichar en cualquiera, el formulario desaparece sin dejar la fecha en la casilla.

Si pongo datepicker, con el mismo código, sin el formulario, funciona perfectamente.

Significa que son incompatibles?

Un saludo, muchas gracias
  #2 (permalink)  
Antiguo 20/08/2010, 11:29
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 9 meses
Puntos: 1532
Respuesta: Formulario mootools+jquery, añadir datepicker??

el problema son los frameworks, mootools y jquery son incompatibles entre sí, jquery tiene una alternativa para funcionar en conjunto con otro framework, pero jquery no posee datepickers, sino jQueryUI y no se si funcione adecuadamente con mootools.

re recomiendo jscalendar que es un calendario completamente independiente de frameworks y muy bueno
  #3 (permalink)  
Antiguo 20/08/2010, 11:58
Avatar de NaRanJiTo78  
Fecha de Ingreso: noviembre-2007
Ubicación: In the BeaCh
Mensajes: 874
Antigüedad: 16 años, 5 meses
Puntos: 10
Respuesta: Formulario mootools+jquery, añadir datepicker??

Gracias por tu respuesta, maycolalvarez!!!


El problema esque probé datepicker porque con jscalendar me pasaba lo mismo...porqué puede ser?

Pongo el ejemplo y código por si alguien me puede ayudar y/o sirve?
  #4 (permalink)  
Antiguo 20/08/2010, 13:37
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Tema movido desde PHP a Frameworks y Plugins Javascript
  #5 (permalink)  
Antiguo 20/08/2010, 13:55
Avatar de seik!  
Fecha de Ingreso: mayo-2006
Mensajes: 492
Antigüedad: 17 años, 10 meses
Puntos: 6
Respuesta: Formulario mootools+jquery, añadir datepicker??

Cita:
Iniciado por NaRanJiTo78 Ver Mensaje
Gracias por tu respuesta, maycolalvarez!!!


El problema esque probé datepicker porque con jscalendar me pasaba lo mismo...porqué puede ser?

Pongo el ejemplo y código por si alguien me puede ayudar y/o sirve?
Si posteas el codigo sera mas facil.

saludos
__________________
sEIK! -Chile-
Analista Programador.
  #6 (permalink)  
Antiguo 22/08/2010, 05:41
Avatar de NaRanJiTo78  
Fecha de Ingreso: noviembre-2007
Ubicación: In the BeaCh
Mensajes: 874
Antigüedad: 16 años, 5 meses
Puntos: 10
Respuesta: Formulario mootools+jquery, añadir datepicker??

Hola de nuevo!

El formulario se encuentra aqui:

http://www.firenetworks.eu/Formulario/index.php

Como se puede ver, al presionar el calendario de jscalendar, no funciona...

He aqui el código:

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.  
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.  
  5. <?php
  6.  
  7. //User info (DO NOT EDIT!)
  8.  
  9. $name = stripslashes($_POST['name']); //sender's name
  10. $email = stripslashes($_POST['email']); //sender's email
  11.  
  12. //The subject
  13.  
  14. $subject  = "[Formulario de Contacto] "; //The default subject. Will appear by default in all messages. Change this if you want.
  15.  
  16. $subject .= stripslashes($_POST['subject']); // the subject
  17.  
  18. //The message you will receive in your mailbox
  19.  
  20. //Each parts are commented to help you understand what it does exaclty.
  21.  
  22. //YOU DON'T NEED TO EDIT IT BELOW BUT IF YOU DO, DO IT WITH CAUTION!
  23. $msg  = "De : $name \r\n";  //add sender's name to the message
  24.  
  25. $msg .= "e-mail : $email \r\n";  //add sender's email to the message
  26. $msg .= "Asunto : $subject \r\n\n"; //add subject to the message (optional! It will be displayed in the header anyway)
  27. $msg .= "---Mensaje--- \r\n".stripslashes($_POST['message'])."\r\n\n";  //the message itself
  28. //Extras: User info (Optional!)
  29. //Delete this part if you don't need it
  30.  
  31. //Display user information such as Ip address and browsers information...
  32.  
  33. $msg .= "---User information--- \r\n"; //Title
  34.  
  35. $msg .= "User IP : ".$_SERVER["REMOTE_ADDR"]."\r\n"; //Sender's IP
  36. $msg .= "Browser info : ".$_SERVER["HTTP_USER_AGENT"]."\r\n"; //User agent
  37. $msg .= "User come from : ".$_SERVER["HTTP_REFERER"]; //Referrer
  38. // END Extras
  39. ?>
  40.  
  41.  
  42.  
  43.  
  44. <title>Formulario de Contacto</title>
  45. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  46. <link rel="stylesheet"  href="css/main.css" type="text/css" media="screen" />
  47. <link href="css/calendar.css" type="text/css" rel="stylesheet">
  48.  
  49. <script type="text/javascript" src="js/mootools.js"></script>
  50.  
  51. <!-- Formcheck2 / Moo.Floor.ch -->
  52.  
  53. <!-- http://moo.floor.ch/?p=18 -->
  54.  
  55. <script type="text/javascript" src="js/formcheck.js"></script>
  56. <script type="text/javascript">
  57.  
  58.     window.addEvent('domready', function(){check = new FormCheck('third', {
  59.  
  60.         display : {
  61.  
  62.             fadeDuration : 500,
  63.  
  64.             errorsLocation : 1,
  65.  
  66.             indicateErrors : 1,
  67.  
  68.             showErrors : 1
  69.  
  70.         }
  71.  
  72.     })});
  73.  
  74.  
  75. <script type="text/javascript" src="js/niceforms.js"></script>
  76.  
  77. <style type="text/css">
  78. <!--
  79. body {
  80.     background-color: #FFF;
  81. }
  82.  
  83. -->
  84. </style></head>
  85.  
  86.  
  87. <!-- The contact form starts here-->
  88.  
  89. <?php
  90.  
  91.   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
  92.  
  93.      $self = $_SERVER['PHP_SELF'];
  94.  
  95. ?>
  96.  
  97.  
  98.  
  99.     <!-- Start HTML form -->
  100. <div id="backform">
  101.     <form name="form" method="post" id="third" action="<?php echo $self;?>"  class="niceform">
  102.  
  103.         <h1>Formulario de contacto</h1>
  104.  
  105.         <!-- Name -->
  106.  
  107.         <label for="name"><strong><span class="blue">*</span> Nombre : </strong></label>
  108.  
  109.             <input id="name" name="name" type="text" class="validate['required','length[3,-1]','nodigit']" size="20" />
  110.  
  111.  
  112.  
  113.         <!-- Email -->
  114.  
  115.         <label for="email"><strong><span class="blue">*</span> Email : </strong></label>
  116.  
  117.             <input id="email" name="email" type="text" class="validate['required','length[5,-1]','email']" size="20" />
  118.  
  119.  
  120.  
  121.         <!-- Website -->
  122.       <label for="fecha"><strong><span class="blue">*</span> Fecha : </strong></label>
  123.  
  124. <script src="js/calendar.js" type="text/javascript"></script>
  125. <script src="js/calendar-es.js" type="text/javascript"></script>
  126. <script src="js/calendar-setup.js" type="text/javascript"></script>
  127.             <input type="text" name="ingreso" id="ingreso" value="dd-mm-yyyy" size="15"/>
  128. <img src="images/calendario.png" width="16" height="16" border="0" title="Fecha Inicial" id="lanzador">
  129. <!-- script que define y configura el calendario-->
  130. <script type="text/javascript">
  131.    Calendar.setup({
  132.     inputField     :    "ingreso",     // id del campo de texto
  133.      ifFormat     :     "%d-%m-%Y",     // formato de la fecha que se escriba en el campo de texto
  134.      button     :    "lanzador"     // el id del botón que lanzará el calendario
  135. });
  136.         <!-- Subject -->
  137.  
  138.   <label for="subject"><strong><span class="blue">*</span> Asunto : </strong></label>
  139.  
  140.             <input id="subject" name="subject" type="text" class="validate['required']" size="20" />
  141.  
  142.  
  143.  
  144.         <!-- Message -->
  145.  
  146.         <label for="msg"><strong><span class="blue">* </span>Tu mensaje : </strong></label><br />
  147.  
  148.             <textarea id="message" name="message" type="text" class="validate['required']" rows="10" cols="30"></textarea>
  149.  
  150.  
  151.  
  152.         <!-- Spam Check -->
  153.  
  154.         <label for="spamcheck"><span class="blue">*</span> <acronym  title="[ Spam prevention ]">Cuanto es la suma?</acronym> : <span class="blue"> 2 + 3 = ???</span>
  155.           <input id="spamcheck" name="spamcheck" type="text" size="5" class="validate['required','number','spamcheck']" />
  156.         </label>
  157.     <br /><br />
  158.  
  159.         <input type="submit" class="buttonSubmit" value="Enviar!" />
  160.  
  161.  
  162.  
  163.         <!-- Niceforms: mouse over effect -->
  164.  
  165.         <!-- Do not remove the line below -->
  166.  
  167.       <div id="stylesheetTest"></div>
  168.  
  169.  
  170.  
  171.     </form>
  172. </div>
  173. <div id="backform2"></div>
  174. <?php
  175.  
  176.     } else {
  177.  
  178.        error_reporting(0);
  179.  
  180.  
  181.  
  182.         if  (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"))
  183.  
  184.  
  185.  
  186.         //Message sent!
  187.  
  188.         //It the message that will be displayed when the user click the sumbit button
  189.  
  190.         //You can modify the text if you want
  191.  
  192.         echo nl2br("
  193.         <div class=\"MsgSent\">
  194.  
  195.             <h1>Enhorabuena!</h1>
  196.  
  197.             <p>Muchas gracias <b><?=$name;?></b>, tu mensaje ha sido enviado!<br /> Te responderemos a la mayor brevedad.</p>
  198.  
  199.         </div>
  200.  
  201.        ");
  202.  
  203.  
  204.  
  205.         else
  206.  
  207.  
  208.  
  209.         // Display error message if the message failed to send
  210.  
  211.         echo "
  212.  
  213.         <div class=\"MsgError\">
  214.  
  215.             <h1>Error!!</h1>
  216.  
  217.             <p>Sorry <b><?=$name;?></b>, your message failed to send. Try later!</p>
  218.  
  219.         </div>";
  220.  
  221.     }
  222.  
  223. ?>
  224.  
  225. </body>
  226.  
  227. </html>

Última edición por NaRanJiTo78; 22/08/2010 a las 05:58
  #7 (permalink)  
Antiguo 22/08/2010, 08:43
Avatar de NaRanJiTo78  
Fecha de Ingreso: noviembre-2007
Ubicación: In the BeaCh
Mensajes: 874
Antigüedad: 16 años, 5 meses
Puntos: 10
Respuesta: Formulario mootools+jquery, añadir datepicker??

Alguien me puede ayudar?
  #8 (permalink)  
Antiguo 22/08/2010, 15:34
Avatar de NaRanJiTo78  
Fecha de Ingreso: noviembre-2007
Ubicación: In the BeaCh
Mensajes: 874
Antigüedad: 16 años, 5 meses
Puntos: 10
Respuesta: Formulario mootools+jquery, añadir datepicker??

Nadie?

Etiquetas: añadir, datepicker, formulario
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:55.