Advertisement
GWibisono

asas atatta

Jan 2nd, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3.     <title>MultiSubmit Form</title>
  4. </head>
  5. <body>
  6.     <form action="user/register" method="POST" id='nasgor'>
  7.         <H3>WAJIB DI ISI!</H3>
  8.         <label for="username"><input type="text" name="username" />
  9.         <label for="email"><input type="text" name="email" />
  10.         <label for="password"><input type="password" name="password" />
  11.         <label for="check_pass"><input type="password" name="chk_password" />
  12.         <button type="button" onclick='form1()'>Submit 1</button>
  13.         <!-- SUBMIT MANDATORY -->
  14.         <H3>Sebaiknya juga DI ISI!</H3>
  15.         <label for="birthplace"><input type="text" name="birthplace" />
  16.         <label for="birthdate"><input type="text" name="birthdate" />
  17.         <label for="sex"><input type="text" name="sex" />
  18.         <label for="relation"><input type="text" name="relation" value="single and hepi" />
  19.         <button type="button" onclick='form2()'>Submit 2</button>
  20.         <!-- SUBMIT MANDATORY -->
  21.         <H3>Ngga WAJIB DI ISI!</H3>
  22.         <label for="address1"><input type="text" name="address1" />
  23.         <label for="address2"><input type="text" name="address2" />
  24.         <label for="postalcode"><input type="text" name="postalcode" />
  25.         <label for="phone_no"><input type="text" name="phone_no" />
  26.         <buttontype="button" onclick='form3()'>Submit 3</button>
  27.         <!-- SUBMIT MANDATORY -->
  28.     </form>
  29. <script>
  30. function form1()
  31. {
  32.   var selectorform="form#nasgor";
  33.     var datax = $(selectorform).serialize();
  34.     var request = $.ajax({
  35.           url: "?act=tes",
  36.           type: "POST",
  37.           data: datax,
  38.           dataType: "json"
  39.     });
  40.      
  41.     request.success(function(msg) {
  42.       $(".satu").html( msg.satu );
  43.       $(".dua").html( msg.dua    );
  44.     });
  45.      
  46.     request.fail(function(jqXHR, textStatus) {
  47.       alert( "Request failed: " + textStatus );
  48.     });
  49. }
  50. /*
  51. sisanya samakan kayak di atas
  52. */
  53. </script>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement