a()是什么?或是说a()输出什么?
请注意,b/s结构中js和php要通过http协议沟通。

解决方案 »

  1.   

    哦sorry,a()是在PHP中定义的函数,是这样的
    <?php
    function a()
    {
    $conn(); //connect the database
    $sql="select a,b.. from datatable where tima='".$show."'";
    $result=mysql_fetch_array(mysql_query($sql));
    }
    ?>
    <form action="...." method="post">
    <input type="text" onKeyPress="<?php a(); ?>" name="show">
    <input type="text" value="<?php echo $result['a'];?>"
    </form>
    对不起,刚才写错了。
    Thanks again!
      

  2.   

    onKeyPress不能响应php的函数,你只能把它提交到服务器进行数据库的操作。
    可以这样写:
    <script language="javascript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    function a()
    {
    show = document.form1.show.value;  
    MM_openBrWindow('处理文件.php?show=' + show ,'','scrollbars=yes,width=540,height=480');
    /**处理文件.php,你是新开窗口还是别的,自己看着处理就行了***/
    }
    //-->
    </script>
    <form action="...." method="post" name=form1>
    <input type="text" onKeyPress="javascript:a()" name="show">
    <input type="text" value="<?php echo $result['a'];?>"
    </form>
      

  3.   

    onKeyPress是在客户页面下执行的
    不能调用php执行
      

  4.   

    onKeyPress事件发生在客户浏览器端,老大?
      

  5.   

    我明白了,谢谢各位大侠
    不过此贴我打算过两天再结,不知大家愿不愿意更具体的谈谈客房端与服务器端的区别
    TKS very much!