ajaxForum插件post参数

时间:2012-04-13 16:37:49

标签: jquery plugins parameters ajaxform

Hei那里,我开始使用ajaxForm插件,使用这样的表单语句:

<form id="upload" action="upload.php" methor="POST">
<!-- form inputs etc etc -->
</form>

一切正常,但如果我尝试将动作参数从“upload.php”更改为“upload.php?some_param = value”,则只调用upload.php,任何人都有任何关于如何发送另一个参数的想法ajaxForm?

我抬头看了下面的内容:

<script type="text/javascript">
$('#upload').live('change',function() {
$(this).ajaxForm({
success: somefunction, // callback function
//i guess here should be another parameter to be sent to the file, but I couldn't find anything interesting on the web
});
});
</script>

1 个答案:

答案 0 :(得分:0)

尝试在表单中添加一个隐藏字段,其中包含您要发布的值:

<form id="upload" action="upload.php" method="POST">
    <!-- form inputs etc etc -->
    <input type="hiden" value="value" id="some_param" name="some_param" />
</form>

当您发布表单

时,应该发布隐藏字段的值