Ver Mensaje Individual
  #6 (permalink)  
Antiguo 22/02/2012, 06:47
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: oprimir el boton

ummmmm... si te referis a cerrarlo sin haberlo enviado, como si fuera una cancelación, podés hacer esto
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. Mostrar ocultar jquery
  5. <style type="text/css">
  6. /*<![CDATA[*/
  7.  
  8. body {
  9. font-size: 12pt;
  10. font-family: tahoma;
  11. }
  12. span#mostrar{
  13. cursor: pointer;
  14. }
  15. span#mostrar:hover{
  16. color: #99270B;
  17. }
  18. #gracias{
  19. color: #359AFF;
  20. }
  21.  
  22. em{
  23. color: #000;
  24. }
  25. /*]]>*/
  26. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
  27. </head>
  28. <div>
  29. <span id="mostrar">
  30. Complete este formulario
  31. </span>
  32. </div>
  33. <form id="miForm" action="#">
  34. <div>
  35.     <br />
  36. Tu nombre <input type="text" name="nombre" id="nombre" /> <input type="button" id="validar" value="Validar" />
  37. </div>
  38. </form>
  39. <div id="gracias">
  40. Gracias
  41. </div>
  42. <script type="text/javascript">
  43. //<![CDATA[
  44.  
  45. $(document).ready(function(){
  46. $("#miForm").hide();
  47. $("#gracias").hide();
  48.  
  49. $("#mostrar").click(function() {
  50. var txt = $("#miForm").is(':visible') ? 'Complete este formulario' : 'Cancelar envío';
  51. $("#mostrar").text(txt);
  52. $("#miForm").toggle(1000);
  53. });
  54.          
  55. $("#validar").click(function(){
  56. $("#miForm").hide(500);            
  57. $("#mostrar").hide();
  58. var nombre = $("#nombre").val();
  59. $("#nombre").val('');
  60. $("#gracias").html('Gracias <em>' + nombre + '<\/em>');
  61. $("#gracias").show(1500);
  62. });        
  63.        
  64. }); //fin ready
  65.  
  66. //]]>
  67. </body>
  68. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.

Última edición por emprear; 22/02/2012 a las 07:05