表单已提交但值未通过 [英] form is submit but values are not passing

查看:34
本文介绍了表单已提交但值未通过的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用下面的函数提交表单时,它正在提交,但值不会通过此函数传递.我使用了所有功能,但没有找到:

When I submit form by using below function it is submitting but values are not passed through this function. I use all functions but nothing found:

document.getElementById("postad").submit();

表格如下.

<form action="register.php" id="postad" method="post">
    <input class="textfield2" type="text" id="post_title" style="width:640px;" placeholder="Ad Title" onBlur="check('post_title')" />
    <input class="button" type="button" name="save" value="Publish" onclick="send();" />
</form>

推荐答案

您的表单包含两个表单控件.两者都不是成功的控件(即出现在提交的数据中的控件),但出于不同的原因.

Your form contains two form controls. Neither will be a successful control (i.e. one that appears in the submitted data), but for different reasons.

只有具有name 属性的表单控件才能成功.您的文本输入没有 name.(它也没有默认值,所以你需要先输入它)

Only form controls with name attributes can be successful. Your text input doesn't have a name. (It also doesn't have a default value, so you need to type in it first).

按钮只有当它们是用于提交表单的提交按钮时才能成功.您的按钮不是提交按钮,您使用 JavaScript 提交表单.

Buttons can only be successful if they are the submit button used to submit the form. Your button isn't a submit button and you use JavaScript to submit the form.

这篇关于表单已提交但值未通过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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