使用js提交表单form

WBOY
Release: 2016-06-01 09:54:55
Original
2353 people have browsed it

首先我们先用html创建一个表单

Name:

Email:


Copy after login

在这个表单中,我们没用使用submit,我们准备使用js来提交这个表单。首先介绍一下js提交表单的方法。

首先需要获取到form表单,然后使用js的submit()方法来提交表单到服务器。语法如下:

document.getElementById("formid").submit();
Copy after login

完整的代码如下:

 
Name:

Email:


Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!