health3.jsp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  3. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  4. <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
  5. <script type="text/javascript" src="/resources/js/mobile/health.js"></script>
  6. <script>
  7. $.validator.addMethod( "rangeOxygenSaturation", function( value, element ) {
  8. var result = true;
  9. if( value > 100 || value < 0 ) {
  10. result = false;
  11. }
  12. return this.optional(element) || result;
  13. }, "산소포화도는 [0 ~ 100] 사이의 숫자만 입력해주세요" );
  14. $( function(){
  15. $( "#healthForm" ).validate({
  16. rules : {
  17. oxygenSaturation : {
  18. floatNum : true,
  19. floatNumOne : true,
  20. rangeOxygenSaturation : true
  21. }
  22. },
  23. onkeyup: function( element, event ) {
  24. // $( "div.error-msg" ).text( "" );
  25. $( element ).valid();
  26. },
  27. onfocusout: function (element) {
  28. // $( "div.error-msg" ).text( "" );
  29. $( element ).valid();
  30. },
  31. errorPlacement: function(error, element) {
  32. $( "div.error-msg" ).empty().append( error );
  33. },
  34. submitHandler: function(form) {
  35. var oxygenSaturation = $.trim( $( "input[name='oxygenSaturation']" ).val() );
  36. if( oxygenSaturation.length == 0 ) {
  37. $( "div.error-msg" ).text( "산소포화도 % 를 입력하세요 (Please enter your oxygen saturation)" );
  38. } else {
  39. $( "#phrValue" ).val( oxygenSaturation );
  40. form.submit();
  41. }
  42. }
  43. });
  44. })
  45. </script>
  46. </head>
  47. <body>
  48. <div id="sub">
  49. <div class="container">
  50. <div class="header">
  51. <div class="previous">
  52. <a href="/mobile/menu">이전</a>
  53. </div>
  54. <div class="title">건강정보기록</div>
  55. </div>
  56. <div class="device_tab">
  57. <ul>
  58. <li>
  59. <a href="./1" class="one">체온<span class="eng">body temperature</span></a>
  60. </li>
  61. <li>
  62. <a href="./2" class="two">혈압/맥박수<span class="eng">blood pressure/heart rate</span></a>
  63. </li>
  64. <li>
  65. <a href="./3" class="three active">산소포화도<span class="eng">oxygen</span></a>
  66. </li>
  67. <li>
  68. <a href="./4" class="four">혈당<span class="eng">blood sugar</span></a>
  69. </li>
  70. <li>
  71. <a href="./5" class="five">임상증상<span class="eng">symptom</span></a>
  72. </li>
  73. </ul>
  74. </div>
  75. <form id="healthForm" method="post" action="./insert">
  76. <div class="health">
  77. <div class="part">
  78. <div class="title">날짜(Date)</div>
  79. <div class="input day">
  80. <!-- <a href="javascript:;" data-popup-open="popup-calendar">d</a> -->
  81. <input type="text" class="datePicker form-control" placeholder="현재 날짜" readonly>
  82. </div>
  83. </div>
  84. <div class="part">
  85. <div class="title">측정시간(Time)</div>
  86. <div class="input time">
  87. <!-- <a href="javascript:;" data-popup-open="popup-time">d</a> -->
  88. <input type="text" class="timePicker" placeholder="현재 시간" readonly>
  89. </div>
  90. </div>
  91. <div class="part tac mt30">
  92. <div class="title">산소포화도를 입력해주세요</div>
  93. <div class="title">(Please enter your oxygen saturation)</div>
  94. <div class="input time">
  95. </div>
  96. </div>
  97. <div class="data unlink">
  98. <div class="point">
  99. <span>
  100. <input type="number" name="oxygenSaturation" placeholder="--"> %
  101. </span>
  102. </div>
  103. </div>
  104. <div class="error-msg tac mt20 error"></div>
  105. </div>
  106. <div class="btn_group">
  107. <ul>
  108. <li>
  109. <input type="hidden" name="phrType" value="oxygenSaturation">
  110. <input type="hidden" id="phrValue" name="phrValue" value="">
  111. <!-- <input type="hidden" id="phrValue2" name="phrValue2" value=""> -->
  112. <button type="submit" class="confirm"><span class="check">기록하기(Submit)</span></button>
  113. </li>
  114. </ul>
  115. </div>
  116. </form>
  117. </div>
  118. </div>
  119. </body>
  120. </html>