Advertisement
Guest User

Formulario

a guest
Jun 10th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.41 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang = "es">
  3. <head>
  4.     <meta charset = "UTF-8" />
  5.     <title>Orion</title>
  6.     <style type="text/css">
  7.         .labels *, .inputs *{
  8.             display: block;
  9.             margin-bottom: .5em;
  10.         }
  11.  
  12.         .labels, .inputs{
  13.             display: inline-block;
  14.         }
  15.  
  16.         [type=submit]{
  17.             display: block;
  18.         }
  19.     </style>
  20. </head>
  21. <body>
  22.     <form id = "miFormulario" method = "post" action = "destino.php">
  23.     <section class = "labels">
  24.         <label for = "nombre">Nombre:</label>
  25.         <label for = "edad">Edad:</label>
  26.     </section>
  27.     <section class = "inputs">
  28.         <input type = "text" id = "nombre" name = "nombre" placeholder = "Ingrese su nombre" autofocus />
  29.         <input type = "text" id = "edad" name = "edad" placeholder = "Ingrese su edad" />
  30.     </section>
  31.         <input type = "submit" value = "Enviar" />
  32.     </form>
  33.  
  34.     <p id = "salida"></p>
  35.  
  36.     <script language = "javascript" type = "text/javascript" src = "http://orion.byethost24.com/Orion/orion.js"></script>
  37.     <script language = "javascript" type = "text/javascript">
  38.         Orion("#miFormulario").enviar(function(event){
  39.             event.preventDefault();
  40.             Orion.ajax({
  41.                 uri: Orion(this).prop("action"),
  42.                 metodo: Orion(this).prop("method"),
  43.                 tipo: "HTML",
  44.                 datos: Orion(this).serializar(),
  45.                 exito: function(respuesta){
  46.                     Orion("#salida").valor(respuesta);
  47.                 },
  48.                 error: function(textoError){
  49.                     Orion("#salida").valor(textoError);
  50.                 }
  51.             });
  52.         });
  53.     </script>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement