Advertisement
dmilosavleski

5 - 3

Dec 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Трета задача</title>
  6. <link rel="stylesheet" type="text/css" href="js/jquery-ui.css">
  7. <script type="text/javascript" src="js/jquery.js"></script>
  8. <script type="text/javascript" src="js/jquery-ui.js"></script>
  9.  
  10. <script>
  11.  
  12. $(function() {
  13. $( "#datepicker" ).datepicker();
  14. });
  15.  
  16. $(function() {
  17. $("#selectable").bind("mousedown", function(e) {
  18. e.metaKey = true;
  19. }).selectable();
  20. });
  21. $(function() {
  22.  
  23. $('#save').click(function () {
  24.  
  25. $('#dialog').attr('title', 'User Info').text('Name: '+$('#first-name').val()+'\n'
  26. +'Surname: '+$('#last-name').val()+'\n'+'Password: '+$('#password').val()+
  27. '\n'+' Date of Birth: '
  28. +$('#datepicker').val()+'\n'+'Hobbies: '+$('selected#selectable').val()).dialog();
  29. });
  30. });
  31. </script>
  32.  
  33. <style type="text/css">
  34.  
  35. span{
  36. display: none;
  37. color: red;
  38. }
  39.  
  40. label{
  41. display: inline-block;
  42.  
  43. margin: 5px 0px 6px 0px;
  44. width: 80px;
  45. }
  46. input{
  47. margin: 4px;
  48. width: 150px;
  49. }
  50. #container1{
  51. position: relative;
  52. }
  53. #selectable .ui-selecting { background: #FECA40; }
  54. #selectable .ui-selected { background: #F39814; color: white; }
  55. #selectable { list-style-type: none; margin: 0; padding: 0; width: 98%; }
  56. #selectable li { margin: 3px; padding: 0.4em;}
  57.  
  58. #save{
  59.  
  60. margin-top: 15px;
  61. width: 33%;
  62. }
  63.  
  64.  
  65. </style>
  66. </head>
  67. <body>
  68. <form id="commentForm">
  69. <div id="container1" style="left: 35%">
  70. <label>Name:</label>
  71. <input type="text" id="first-name" placeholder="Name"> <span>Insert a name</span><br>
  72. <label>Surname:</label>
  73. <input type="text" id="last-name" placeholder="Surname"><span>Insert a surname</span> <br>
  74. <label>Password:</label>
  75. <input type="password" id="password" placeholder="Password"><span>Insert a password</span> <br>
  76. <label>DateOfBirth:</label>
  77. <input type="text" id="datepicker" placeholder="Date Of Birth"> <span>Insert a date</span><br> <br>
  78. </div>
  79. <div id="container2" style="width:300px; margin:0 auto;">
  80. <p>Select your hobbies</p>
  81. <ul id="selectable">
  82. <li class="ui-widget-content" value="gaming">Gaming</li>
  83. <li class="ui-widget-content" value="sports">Sports</li>
  84. <li class="ui-widget-content" value="tv">Watching Tv</li>
  85. <li class="ui-widget-content" value="sleeping">Sleeping</li>
  86. <li class="ui-widget-content" value="hiking">Hiking</li>
  87. <li class="ui-widget-content" value="skiing">Skiing</li>
  88. <li class="ui-widget-content" value="dancing">Dancing</li>
  89. </ul>
  90. <input id="save" type="button" value="Add my Info"/>
  91. <div id="dialog"></div>
  92. </div>
  93.  
  94. </form>
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement