jQuery,PHP表单回显不起作用 [英] jQuery, PHP form echo does not work

查看:81
本文介绍了jQuery,PHP表单回显不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你们是否可以让我知道下面的错误,由于某些原因,当我单击删除图像时,该图像应该从dela.php文件返回回显,但不会.

Could you guys let me know what is wrong below, for some reason, when I click on the delete image, which is supposed to return the echo from dela.php file, but does not.

<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $('#del_form').ajaxForm({
            target: '#del',
            success: function() {
                $('#del').fadeIn(40000);
            }
        });
    });
</script>

<div>
    <form action="dela.php" id="del_form" method="post">
        <input type="image" src="del.gif" id="al_del" value="clicked" />
        click the image on the left
    </form>
</div>
<div id="del" style="background-color:#FFFF99; width:200px; height:100px;"></div>

// dela.php
<?
    if ($_POST['al_del']) {
        echo 'variable pass success';
    }
?>

推荐答案

POST变量基于输入名称,而不是ID的afaik.

POST variables are based on input names, not ID's, afaik.

我通常也会去


if(isset($_POST['al_del']))

但这是一个侧边栏.

这篇关于jQuery,PHP表单回显不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆