Php 表格不';无法在自动刷新的页面上提交

Php 表格不';无法在自动刷新的页面上提交,php,javascript,jquery,form-submit,page-refresh,Php,Javascript,Jquery,Form Submit,Page Refresh,我有PHP的web应用程序,我需要在这个页面中的一些变量来自动刷新。因此,我将该处理放在另一个页面“test.php”中,该页面每10秒加载一次这个div <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript"> var auto_re

我有PHP的web应用程序,我需要在这个页面中的一些变量来自动刷新。因此,我将该处理放在另一个页面“test.php”中,该页面每10秒加载一次这个div

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval( function ()
{
 $('#refresh').load('test.php').fadeIn("slow");
 }, 10000);
</script>
</head>
<body>
<div id="refresh">
</div>
</body></html>

var auto_refresh=setInterval(函数()
{
$('#refresh').load('test.php').fadeIn(“slow”);
}, 10000);
问题是这个页面有一个表单,它在单击时不会提交值,也不会按照它应该做的那样进行处理。如果没有自动刷新代码,它可以正常工作。我如何克服这个问题

test.php包含以下表单:

<form action="count.php" method="post">
<?php 

$votes = getVoteCount($popular[$i][1]); 

$voted=checkVoted($screenName,$id);?>

<td><img src="<?php echo $popular[$i][4]; ?>" width=60></td>
<td align="center"><CITE><?php echo "@".$username; ?></CITE>
                    <?php echo "<br >".$text.
                              "<br >".$votes." votes |";?>
    <?php 
    if($screenName!=$username && $voted==false){
    ?>
    <input type="hidden" name="addID" value="<?php echo $id;?>">
    <input type="hidden" name="username" value="<?php echo $screenName;?>">
    <INPUT TYPE="image" src="images/vote.png" name='vote' ALT="Submit Form" onMouseOver="this.src='images/vote_link.png'"
    onMouseOut="this.src='images/vote.png'" width="35" height="20" title="Click to Vote!"></form>
    <?php }else if($voted){ ?>
    <img src="images/voted.png" width="35" height="20" title="You have already voted">
        <?php    } else{
    echo "<img src='images/authored.png' width='40' height='20'>";
    }?>

“宽度=60>

因为您正在使用不再可以使用的ajax请求重新加载页面

$("submit-button").click() 

您需要使用jquery的live、delegate或on来执行此操作。(live不再是推荐的执行此操作的方式

$("body").on("click", "submit-button", function()
 {
     //execute code here
 });


加载的表单是什么样子的?你用什么来提交?Javascript,表单…?@Muhammad:我在test.php中添加了表单标签page@PFY-我正在使用表单提交,将输入更改为常规的
img
标记,并添加onclick操作以提交表单
$("body").on("click", "submit-button", function()
 {
     //execute code here
 });
$("body").on("submit", "submit-form", function()
 {
     //execute code here
 });