Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
- <script src="/resources/demos/external/jquery.bgiframe-2.1.2.js"></script>
- <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css" />
- <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/blitzer/jquery-ui.css" type="text/css" />
- <link href="timepicker.css" rel="stylesheet" type="text/css">
- <script src="timepicker.js"></script>
- <style>
- body { font-size: 62.5%; }
- label, input { display:block; }
- input.text { margin-bottom:12px; width:95%; padding: .4em; }
- fieldset { padding:0; border:0; margin-top:25px; }
- h1 { font-size: 1.2em; margin: .6em 0; }
- div#time-contain { width: 350px; margin: 20px 0; }
- div#time-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
- div#time-contain table td, div#time-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
- .ui-dialog .ui-state-error { padding: .3em; }
- .validateTips { border: 1px solid transparent; padding: 0.3em; }
- </style>
- <script>
- // $(document).ready(function() {
- // $('#timepick').on("click", function(){
- // timepicker({
- // showPeriod: true,
- // showLeadingZero: true
- // });
- // });
- $(document).ready(function() {
- $('#timepick').timepicker({
- showPeriod: true,
- showLeadingZero: true
- });
- });
- $(function() {
- $( "#dialog-form" ).dialog({
- autoOpen: false,
- height: 300,
- width: 350,
- modal: true,
- buttons: {
- "Add Time": function() {
- $( "#time-table tbody" ).append( "<tr>" +
- "<td>" + time.value + "</td>" +
- "</tr>" );
- $( this ).dialog( "close" );
- },
- Cancel: function() {
- $( this ).dialog( "close" );
- }
- },
- });
- $("#add-time").button().click(function() {
- $( "#dialog-form" ).dialog( "open" );
- });
- });
- </script>
- </head>
- <body>
- <div id="dialog-form" title="Create new user">
- <p class="validateTips">All form fields are required.</p>
- <form>
- <fieldset>
- <label for="time">Time</label>
- <input type="text" id="time" name="time" style="width: 70px;" id="timepick" value="01:30 PM" />
- </fieldset>
- </form>
- </div>
- <div id="time-contain" class="ui-widget">
- <table id="time-table" class="ui-widget ui-widget-content">
- <thead>
- <tr class="ui-widget-header ">
- <th>Time</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>1:50 PM</td>
- </tr>
- </tbody>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement