Explorar el Código

모바일 로그인 생치 지역 선택 수정

huiwon.seo hace 4 años
padre
commit
09afeb98a9
Se han modificado 1 ficheros con 9 adiciones y 7 borrados
  1. 9 7
      src/main/webapp/WEB-INF/jsp/mobile/login/login.jsp

+ 9 - 7
src/main/webapp/WEB-INF/jsp/mobile/login/login.jsp

@@ -8,6 +8,7 @@ $( function(){
     $( "#ex_select" ).siblings('label').text( $( "#ex_select" ).children('option:selected').text() );
     
     $.validator.addMethod('selectcheck', function (value) {
+    	console.log( value );
         return (value != "0" );
     }, "" );
     
@@ -19,9 +20,6 @@ $( function(){
             pw : {
                 required: true
             },
-            locationCode : {
-                selectcheck : true
-            },
             centerCode : {
                 selectcheck : true
             }
@@ -78,17 +76,19 @@ $( function(){
             console.log($('#locationList').val());
 //             $('#centerDiv').css("display", "block");
 
-            $( "#centerList option" ).hide();
-            if ($( "#centerList option[accessKey='"+$('#locationList').val()+"']" ).length == 0) {
+            $( "#centerList option:not([value='0'])" ).appendTo( "#hideList" );
+            
+            if ($( "#hideList option[accessKey='"+$('#locationList').val()+"']" ).length == 0) {
                 $("#centerLabel").text("등록된 생활치료센터가 없습니다.");
 //               var option = "<option value='99' selected>등록된 생활치료센터가 없습니다.</option>";
 //               $('#centerList').append(option);
             } else {
                 $("#centerLabel").text("치료센터 선택");
-                $( "#centerList option[accessKey='"+$('#locationList').val()+"']" ).show();
+                $( "#hideList option[accessKey='"+$('#locationList').val()+"']" ).appendTo( "#centerList" );
             }
         } else {
-            $( "#centerList option" ).show();
+        	$( "#centerList option:not([value='0'])" ).appendTo( "#hideList" );
+            $( "#hideList option" ).appendTo( "#centerList" );
             $("#centerLabel").text("치료센터 선택");
         }
     });
@@ -140,6 +140,8 @@ function autoLogin(){
                                         <option value="${i.centerCode}" accessKey="${i.locationCode}"> · <c:out value="${i.centerName}" /></option> 
                                     </c:forEach>
                                 </select>
+                                
+                                <select id="hideList" style="display:none;"></select>
                             </div>
                         </div>
                         <div class="part">