如何使用PHP和MySQL转换或查询此Jquery数据,如在表单 – 选择 –
发布时间:2020-12-13 22:45:37 所属栏目:PHP教程 来源:网络整理
导读:我试图像在a中查询这些数据 form name="" action="test" method="post" select name="people" option value="1"1 Person/option option value="2"2 People/option option value="3"3 People/option option value="4"4 People/option option value="5"5 Peopl
我试图像在a中查询这些数据
<form name="" action="test" method="post" <select name="people"> <option value="1">1 Person</option> <option value="2">2 People</option> <option value="3">3 People</option> <option value="4">4 People</option> <option value="5">5 People</option> <option value="6">6 People</option> </select> </form> 这是我需要查询的代码: <div id='content'> <script type="text/javascript"> $(document).ready(function () { var source = [ "Select Your location","North London","South London","West London","East London","City of London",]; // Create a jqxDropDownList $("#jqxDropDownList").jqxDropDownList({ source: source,selectedIndex: 0,width: '250px',height: '35px',theme: 'summer' }); }); </script> <div id='jqxDropDownList'> 解决方法
看看
this demo并查看源代码.可以使jqxDropDownList复制< select>中的项目.标记并将其用作源.
JavaScript // grab all the original options var select_options = $('#people option'); // hide the original select box $('#people').hide(); // Create a jqxDropDownList $("#jqxDropDownList").jqxDropDownList({ width: '200px',height: '25px' }); // Load the data from the Select html element. $("#jqxDropDownList").jqxDropDownList('loadFromSelect','people'); // updates the select's selection. $("#jqxDropDownList").bind('select',function (event) { if (event.args) { var args = event.args; // select the item in the 'select' tag. var index = args.item.index; select_options[index].attr("selected","true"); } }); // selects the first item. $("#jqxDropDownList").jqxDropDownList('selectedIndex','0'); HTML <form method="post" action=""> <label for="people">Number of People</label> <select name="people" id="people"> <option value="1">1 Person</option> <option value="2">2 People</option> <option value="3">3 People</option> <option value="4">4 People</option> <option value="5">5 People</option> <option value="6">6 People</option> </select> <div id="jqxDropDownList"></div> </form> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |