2012-03-19 2 views
4

jquery mobile select multiple과 관련된 모든 항목을 체크 아웃 했는데도 코드에 무엇이 잘못된 것인지 알 수 없습니다. JQuery 모바일 복수 선택

http://jsfiddle.net/HMWYu/

<!DOCTYPE html> <html> 
<head> <title>Registration</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script> 
</head> 
<body> 
    <div data-role="page" id="home"> 
     <header data-role="header"> 
     <h1>Register</h1> 
    </header> 
     <div data-role="content"> 
         <div data-role="fieldcontain"> 
       <label for="Services" class="ui-hidden-accessible "> 
        Services:</label> 
       <select name="Services" id="Services" multiple="multiple" size="4"> 
        <option >Hotel</option> 
        <option >Transport</option> 
        <option >Others</option> 
       </select> 
      </div> 
     </div> 
      </div> 
</body> 
</html> 

어떤 도움이 될 것

크게

여러에 대한

답변

13

사용 JQM 사용자 선택 메뉴를 감사합니다. http://jquerymobile.com/demos/1.0.1/docs/forms/selects/custom.html 먼저 data-native-menu = "false"를 선택 메뉴에 추가하십시오. 그런 다음 옵션에 값이 있는지 확인하십시오. 레이블 대신 자리 표시 자 역할을하는 옵션 하나를 추가했습니다. 선택한 모든 옵션이 서버로 전송되는,

<!DOCTYPE html> 
<html> 
<head> 
    <title>Registration</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script> 
</head> 
<body> 
<div data-role="page" id="home"> 
    <header data-role="header"> 
     <h1>Register</h1> 
    </header> 
    <div data-role="content"> 
     <div data-role="fieldcontain"> 
      <label for="Services" class="ui-hidden-accessible " > 
       Country: 
      </label> 
      <select name="Services" id="Services" data-native-menu="false" data-mini="true" multiple="multiple" size="4"> 
       <option>Country</option> 
       <option value="hotel">Hotel</option> 
       <option value="transport">Transport</option> 
       <option value="others">Others</option> 
      </select> 
     </div> 
    </div> 
</div> 
</body> 
</html> 
​ 
+1

는 어떻게 확인합니까 : 여기 내 샘플입니까? 내 경우에는 마지막으로 선택한 사람 만 전송됩니다. –

+0

모든 값이 전송됩니다. req.getParameter() 대신 req.getParameterValues ​​()를 수행하고 있습니까? –