Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.74 KB | None | 0 0
  1. <html>
  2.     <head>
  3.       <meta charset="utf-8">
  4.       <meta name="viewport" content="width=device-width, initial-scale=1">
  5.       <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
  6.       <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  7.       <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>      
  8.      
  9.       <script language="javascript">
  10.         $(document).ready(function(){
  11.           $("button").click(function(){
  12.             $.get("http://jsonplaceholder.typicode.com/users/3", function(data, status){
  13.             $("#id").val(data.id);
  14.             $("#name").val(data.name);
  15.             $("#username").val(data.username);
  16.             $("#email").val(data.email);
  17.             $("#website").val(data.website);
  18.             });
  19.           });
  20.         });
  21.       </script>
  22.     </head>
  23.     <body>
  24.         <form action="/action_page.php">
  25.           <div class="form-group">
  26.             <label for="email">ID:</label>
  27.             <input type="email" class="form-control" id="id" name="id">
  28.           </div>
  29.           <div class="form-group">
  30.             <label for="email">Name:</label>
  31.             <input type="email" class="form-control" id="name" name="name">
  32.           </div>
  33.           <div class="form-group">
  34.             <label for="email">Username:</label>
  35.             <input type="email" class="form-control" id="username" name="username">
  36.           </div>
  37.           <div class="form-group">
  38.             <label for="email">Email address:</label>
  39.             <input type="email" class="form-control" id="email" name="email">
  40.           </div>
  41.           <div class="form-group">
  42.             <label for="email">Website:</label>
  43.             <input type="email" class="form-control" id="website" name="website">
  44.           </div>
  45.           <button type="button" class="btn btn-default" name="button" id="button">Submit</button>
  46.         </form>
  47.     </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement