Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Auction</title>
- </head>
- <body>
- <h1>Auction</h1>
- <form id="items" action="">
- <label for="description">Description:</label>
- <input type="text" id="description">
- <br>
- <label for="strt_bid">Starting Bid:</label>
- <input type="text" id="strt_bid">
- <br>
- <input type="submit" value="Submit">
- </form>
- <script src="/socket.io/socket.io.js"></script>
- <script src="https://code.jquery.com/jquery-1.11.1.js"></script>
- <script>
- //Make the connection
- var socket = io();
- //Submit handler
- $("#items").submit(function () {
- //Submit question data
- socket.emit("submit_item", {
- description: $("#description").val(),
- strt_bid: $("#strt_bid").val()
- });
- //Override default behaviour
- return false;
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment