Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE>
- <html>
- <head>
- <title>Bidder</title>
- </head>
- <body>
- <h1>Bidder</h1>
- <form id="bids" action="">
- New Name:
- <span id="n_name"></span>
- <br> Description:
- <span id="description"></span>
- <br> Staring Bid:
- <span id="strt_bid"></span>
- <br>
- <label for="name">Name:</label>
- <input type="text" id="name">
- <br>
- <label for="top_bid">Your Bid:</label>
- <input type="text" id="top_bid">
- <br>
- <input type="submit" value="Submit">
- </form>
- <div id="highest_bid"></div>
- <div id="highest_bidder"></div>
- <div id="test"></div>
- <div id="error"></div>
- <script src="/socket.io/socket.io.js"></script>
- <script src="https://code.jquery.com/jquery-1.11.1.js"></script>
- <script>
- $(document).ready(function () {
- var socket = io();
- //If name is recieved, add it to the HTML page
- socket.on("delivername", function (n_name) {
- $("#n_name").html(n_name);
- });
- // Submit the bid, if user clicks submit button
- $("#bids").submit(function () {
- // Send message to the server with the bid
- socket.emit("top_bid", $("#top_bid").val());
- // Override the default form submit behaviour
- return false;
- });
- // If a result is received, show the user...
- //CODE HERE
- });
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment