Переглянути джерело

앱 증상입력 웹이랑 동일하게 체크 처리

huiwonseo 4 роки тому
батько
коміт
6657beb7e9

+ 3 - 3
src/main/webapp/WEB-INF/jsp/mobile/health/health1.jsp

@@ -6,11 +6,11 @@
 <script>
 $.validator.addMethod( "rangeTemperature",  function( value, element ) {
     var result = true;
-    if( value > 100 || value < 0 ) {
+    if( value > 50 || value < 20 ) {
         result = false;
     }
     return this.optional(element) || result;
-}, "체온은 [0 ~ 100] 사이의 숫자만 입력해주세요" );
+}, "체온은 [20 ~ 50] 사이의 숫자만 입력해주세요" );
 
 $( function(){
     $( "#healthForm" ).validate({
@@ -35,7 +35,7 @@ $( function(){
             $( element ).valid();
         },
         errorPlacement: function(error, element) {
-            $( "div.error-msg" ).append( error );
+            $( "div.error-msg" ).text("").append( error );
             $( "div.error-msg" ).focus();
         },
         submitHandler: function(form) {

+ 15 - 7
src/main/webapp/WEB-INF/jsp/mobile/health/health2.jsp

@@ -6,19 +6,27 @@
 <script>
 $.validator.addMethod( "rangePulseRate",  function( value, element ) {
     var result = true;
-    if( value > 999 || value < 0 ) {
+    if( value > 200 || value < 30 ) {
         result = false;
     }
     return this.optional(element) || result;
-}, "맥박수는 [0 ~ 999] 사이의 숫자만 입력해주세요" );
+}, "맥박수는 [30 ~ 200] 사이의 숫자만 입력해주세요" );
 
-$.validator.addMethod( "rangeBloodPressure",  function( value, element ) {
+$.validator.addMethod( "rangeBloodPressure1",  function( value, element ) {
     var result = true;
-    if( value > 999 || value < 0 ) {
+    if( value > 250 || value < 50 ) {
         result = false;
     }
     return this.optional(element) || result;
-}, "혈압은 [0 ~ 999] 사이의 숫자만 입력해주세요" );
+}, "수축기 혈압은 [50 ~ 250] 사이의 숫자만 입력해주세요" );
+
+$.validator.addMethod( "rangeBloodPressure2",  function( value, element ) {
+    var result = true;
+    if( value > 160 || value < 20 ) {
+        result = false;
+    }
+    return this.optional(element) || result;
+}, "이완기 혈압은 [20 ~ 160] 사이의 숫자만 입력해주세요" );
 
 $( function(){
     $( "#healthForm" ).validate({
@@ -31,12 +39,12 @@ $( function(){
             bloodPressure : {
                 floatNum : true,
                 floatNumOne : true,
-                rangeBloodPressure : true
+                rangeBloodPressure1 : true
             },
             bloodPressure2 : {
                 floatNum : true,
                 floatNumOne : true,
-                rangeBloodPressure : true
+                rangeBloodPressure2 : true
             }
         },
         onkeyup: function( element, event ) {

+ 2 - 2
src/main/webapp/WEB-INF/jsp/mobile/health/health3.jsp

@@ -6,11 +6,11 @@
 <script>
 $.validator.addMethod( "rangeOxygenSaturation",  function( value, element ) {
     var result = true;
-    if( value > 100 || value < 0 ) {
+    if( value > 100 || value < 60 ) {
         result = false;
     }
     return this.optional(element) || result;
-}, "산소포화도는 [0 ~ 100] 사이의 숫자만 입력해주세요" );
+}, "산소포화도는 [60 ~ 100] 사이의 숫자만 입력해주세요" );
 
 $( function(){
     $( "#healthForm" ).validate({

+ 2 - 2
src/main/webapp/WEB-INF/jsp/mobile/health/health4.jsp

@@ -6,11 +6,11 @@
 <script>
 $.validator.addMethod( "rangeBloodSugar",  function( value, element ) {
     var result = true;
-    if( value > 999 || value < 0 ) {
+    if( value > 600 || value < 10 ) {
         result = false;
     }
     return this.optional(element) || result;
-}, "혈당은 [0 ~ 999] 사이의 숫자만 입력해주세요" );
+}, "혈당은 [10 ~ 600] 사이의 숫자만 입력해주세요" );
 
 $( function(){
     $( "#healthForm" ).validate({