Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>MultiSubmit Form</title>
- </head>
- <body>
- <form action="user/register" method="POST" id='nasgor'>
- <H3>WAJIB DI ISI!</H3>
- <label for="username"><input type="text" name="username" />
- <label for="email"><input type="text" name="email" />
- <label for="password"><input type="password" name="password" />
- <label for="check_pass"><input type="password" name="chk_password" />
- <button type="button" onclick='form1()'>Submit 1</button>
- <!-- SUBMIT MANDATORY -->
- <H3>Sebaiknya juga DI ISI!</H3>
- <label for="birthplace"><input type="text" name="birthplace" />
- <label for="birthdate"><input type="text" name="birthdate" />
- <label for="sex"><input type="text" name="sex" />
- <label for="relation"><input type="text" name="relation" value="single and hepi" />
- <button type="button" onclick='form2()'>Submit 2</button>
- <!-- SUBMIT MANDATORY -->
- <H3>Ngga WAJIB DI ISI!</H3>
- <label for="address1"><input type="text" name="address1" />
- <label for="address2"><input type="text" name="address2" />
- <label for="postalcode"><input type="text" name="postalcode" />
- <label for="phone_no"><input type="text" name="phone_no" />
- <buttontype="button" onclick='form3()'>Submit 3</button>
- <!-- SUBMIT MANDATORY -->
- </form>
- <script>
- function form1()
- {
- var selectorform="form#nasgor";
- var datax = $(selectorform).serialize();
- var request = $.ajax({
- url: "?act=tes",
- type: "POST",
- data: datax,
- dataType: "json"
- });
- request.success(function(msg) {
- $(".satu").html( msg.satu );
- $(".dua").html( msg.dua );
- });
- request.fail(function(jqXHR, textStatus) {
- alert( "Request failed: " + textStatus );
- });
- }
- /*
- sisanya samakan kayak di atas
- */
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement