简体   繁体   English

Javascript提交表单未提交

[英]Javascript Submit Form Not Submitting

I created a form name="form" and and included a submit button我创建了一个表单名称 =“表单”并包含一个提交按钮

<button type="submit" id="create" onclick=" go();" name="create">Create</button>

This is my function go()这是我的函数 go()

function go() {

    $("#create").prop("disabled", true);
    document.forms["form"].submit();

}

The function did disable the button, however, it did not submit the form.该功能确实禁用了按钮,但是,它没有提交表单。 Help.帮助。

I know you said you wrapped it in the form however you need to give the button the type Submit and the form the go() function like so:我知道你说过你把它包装在表单中,但是你需要给按钮类型 Submit 和表单go()函数,如下所示:

<form name="form" onSubmit="go()">
  <input type="submit" id="create" value="Create" />
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM