"Form-ESP config"
Bootstrap 3.0.0 Snippet by kj96

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="page-header"> <h1>Set server IP</h1> <h4>Websocket client</h4> </div> <form method="POST" action="/"> <div class="col-md-6"> <div class="input-group spinner"> <input type="text" class="form-control" placeholder="Enter Server IP" name="server_ip"> <div class="input-group-btn-vertical"> <button class="btn btn-default" type="button"><i class="fa fa-caret-up"></i></button> <button class="btn btn-default" type="button"><i class="fa fa-caret-down"></i></button> </div> </div> <p class="help-block">192.168.0.1 (without port)</p> <button class="btn btn-primary" type="submit"><i class="fa fa-globe"></i> Set</button> </div> </form> <div class="col-md-6"> <div class="alert alert-info"> <p>This needs to be done everytime</p> <a href="http://webx.herokuapp.com/connect" target="_blank">Gesture Training</a></div> </div> </div>
@import url(http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css); .spinner input { text-align: right; } .input-group-btn-vertical { position: relative; white-space: nowrap; width: 2%; vertical-align: middle; display: table-cell; } .input-group-btn-vertical > .btn { display: block; float: none; width: 100%; max-width: 100%; padding: 8px; margin-left: -1px; position: relative; border-radius: 0; } .input-group-btn-vertical > .btn:first-child { border-top-right-radius: 4px; } .input-group-btn-vertical > .btn:last-child { margin-top: -2px; border-bottom-right-radius: 4px; } .input-group-btn-vertical i { position: absolute; top: 0; left: 4px; }
$(function(){ $('.spinner .btn:first-of-type').on('click', function() { var btn = $(this); var input = btn.closest('.spinner').find('input'); if (input.attr('max') == undefined || parseInt(input.val()) < parseInt(input.attr('max'))) { input.val(parseInt(input.val(), 10) + 1); } else { btn.next("disabled", true); } }); $('.spinner .btn:last-of-type').on('click', function() { var btn = $(this); var input = btn.closest('.spinner').find('input'); if (input.attr('min') == undefined || parseInt(input.val()) > parseInt(input.attr('min'))) { input.val(parseInt(input.val(), 10) - 1); } else { btn.prev("disabled", true); } }); })

Related: See More


Questions / Comments: