我正在尝试编写一个自动完成,当PHP页面加载时,自动完成项加载一次.使用从mysql DB获取的项目,我创建了一个像这样的json数组
<?php
$bnkArray = array();
$sql_bnk = mysql_query("SELECT BName, BCode, ID FROM bank");
while($rBnk = mysql_fetch_array($sql_bnk)){
$bnkDet = array(
'label' => $rBnk['BName'],
'value' => $rBnk['BName'],
'otherDetails' => $rBnk['BName'].'||'. $rBnk['BCode'].'||'. $rBnk['ID']
);
array_push($bnkArray, $bnkDet);
}
?>
Run Code Online (Sandbox Code Playgroud)
我需要这个数组像这个javascript数组
<script>
var bankSource11 = [
{
value: "jquery",
label: "jQuery",
otherDetails: "the write less, do more, JavaScript library",
},
{
value: "jquery-ui",
label: "jQuery UI",
otherDetails: "the official user interface library for jQuery",
},
{
value: "sizzlejs",
label: "Sizzle JS",
otherDetails: "a pure-JavaScript …Run Code Online (Sandbox Code Playgroud) 我正在使用包含的引导程序模板,
jQuery的1.9.1.min.js
jquery.flot.js
jquery.flot.resize.js
jquery.dataTables.js.
<?php
ob_start();
$path = '../';
$title = 'Leave Dates';
include($path.'header.php');
include($path.'side.php');
include("brnch_session.php");
$sql_br = mysql_query("SELECT br_name FROM branch_data WHERE ID = '$br_id'");
$res_br = mysql_fetch_row($sql_br);
?>
<!-- live search -->
<link href="<?php echo $path ?>/css/live_search.css" rel="stylesheet" media="screen">
<!--date picker files-->
<link href="../datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="../datetimepicker/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="../datetimepicker/js/bootstrap-datetimepicker.ua.js" charset="UTF-8"></script>
<script>
$(document).ready(function() {
$("#txt_check").keyup(function(){
$("#txt_check").css("background-color", "RED");
alert('you cant');
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
HTML
<?php include('mini_top.php'); ?>
<?php
$run=mysql_query("SELECT * FROM student_infor where br_code='$br_id'");
$nor= …Run Code Online (Sandbox Code Playgroud) 我需要一个这样的模式[081 222 2224],数字限制为10 ..这是我的尝试
<form action="" method="post" id="cusCreate" autocomplete="off">
<input type="tel" name="telphone" pattern="[0-9]{10}" title="Ten digits code" required/>
<label style="font-size:9px;padding-left:20px"> Eg : 081 222 2224 </label>
<input type="submit" value="Submit"/>
</form>
Run Code Online (Sandbox Code Playgroud)