变量未从Javascript传递

变量未从Javascript传递

我有两个未写的用于儿童检查系统的搜索框。我已经将输入框升级为jquery自动完成。它们有效,我按名称搜索,然后输入ID号。

但是,当我单击“验证”时,应显示每个人的照片,成年人不会发生任何事情。成人字段是可选字段,第二个字段是可选字段。我认为这是我的问题。

更新:如果我注释掉第一个自动完成框“孩子”,而十个不打扰成人,它将起作用。我一直在跳过实际的自动完成部分,只是在框中输入数字,而我遇到了同样的错误。

<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>

最佳答案

您应该从有效的html页面开始。

一些例子:


您在不允许使用的所有元素中都有<head>个元素;
您有不允许使用<body>元素的地方;
您具有嵌套的表单标签(也是不允许的)。

关于php - 变量未从Javascript传递,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15114964/

10-12 14:05