Jquery mobile JQuery移动选择多个
我查看了所有关于jquery mobile select multiple的主题,但仍然无法找出我的代码有什么问题Jquery mobile JQuery移动选择多个,jquery-mobile,Jquery Mobile,我查看了所有关于jquery mobile select multiple的主题,但仍然无法找出我的代码有什么问题 登记处 登记 服务: 酒店 运输 其他 如果您有任何帮助,将不胜感激。使用JQM自定义选择菜单进行多种选择。 首先将数据本机菜单=“false”添加到选择菜单。然后确保您的选项具有值。我添加了一个选项作为占位符来代替标签。 这是我的样本: <!DOCTYPE html> <html> <head> <title>Reg
登记处
登记
服务:
酒店
运输
其他
如果您有任何帮助,将不胜感激。使用JQM自定义选择菜单进行多种选择。 首先将数据本机菜单=“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>
登记处
登记
国家:
国家
酒店
运输
其他
如何确保所有选定选项都发送到服务器?在我的情况下,只发送最后选择的一个。所有值都为我发送。您确定要执行的是req.getParameterValues()而不是req.getParameter()?
<!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>