我有两个搜索框用于儿童入住系统我没写过。我已将输入框升级为jquery自动完成。他们工作,我按名称搜索,然后输入身份证号码。
然而,当我点击“验证”时,应该会显示每个人的照片,而成年人没有任何反应。成人字段是可选的,它是第二个字段。我认为这是我的问题。
更新:如果我注释掉第一个自动完成框“孩子”,并且十个单独离开成人则可行。我一直在跳过实际的自动完成部分,只是在框中键入一个数字,我有同样的错误。
<form method="post" action="Checkin.php" name="Checkin">
<input type="hidden" name="EventID" value="<?php echo $iEventID ; ?>">
<table cellpadding="0" cellspacing="0" width="100%" align="center" border="1">
<tr>
<td>
<caption>
<h3><?php echo gettext("Add Attendees for Event: $event_title"); ?></h3>
</caption>
</td>
</tr>
<tr>
<!-- Right Side new searchbox here-->
<td width="33%" valign="top" align="right">
<head>
<script type="text/javascript" src="jquery/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery/js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
$('#child').autocomplete({source:'suggestname.php', minLength:2});
$.noConflict()
});
</script>
<link rel="stylesheet" href="jquery/css/smoothness/jquery-ui-1.8.2.custom.css" />
<style type="text/css"><!--
/* style the auto-complete response */
li.ui-menu-item { font-size:12px !important; }
--></style>
</head>
<form onsubmit="return false;">
Enter a name:
<input id="child" type="text" name="child" />
</form>
</td>
<!-- Middle -->
<td width="33%" valign="top" align="center">
<input type="submit" class="icButton" <?php echo 'value="' . gettext("Verify") . '"'; ?> Name="Verify" onclick="javascript:document.location='Checkin.php';">
<input type="submit" class="icButton" <?php echo 'value="' . gettext("Back to Menu") . '"'; ?> name="Exit" onClick="javascript:document.location='Checkin.php';">
<input type="button" class="icButton" <?php echo 'value="' . gettext("Add Visitor") . '"'; ?> name="Add" onClick="javascript:document.location='PersonEditor.php';"></td>
<!-- Left Side -->
<td width="33%" valign="top" align="left">
<head>
<script type="text/javascript" src="jquery/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery/js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
$('#adult').autocomplete({source:'suggestname2.php', minLength:2});
$.noConflict()
});
</script>
<link rel="stylesheet" href="jquery/css/smoothness/jquery-ui-1.8.2.custom.css" />
<style type="text/css"><!--
/* style the auto-complete response */
li.ui-menu-item { font-size:12px !important; }
--></style>
</head>
<body>
<form onsubmit="return false;">
Enter a name:
<input id="adult" type="text" name="adult" />
</form>
</body>
</td>
</tr>
<tr>
<td width="33%" align="right">
Child's Name
</td>
<td width="33%" valign="top" align="center">
</td>
<td width="33%" valign="top" align="left">
Adult's Name
</td>
</tr>
</table>
</form>