Introduction to the difference between button and submit
There are four ways to draw a button on a page:
This is a button. If you don't write javascript, nothing will happen when you press it.
Such a button will automatically submit the form after the user clicks it, unless you write javascript to prevent it.
Other tags, such as a, img, span, div, and then use a picture to disguise it as a button.
Submit is a Button specially used to submit forms. There are two main differences from Button:type=button is simply a button function
type=submit is to send a form
(1) Submit uses form submission (form.submit()) as its default event after onclick, but this is not the case for Button
(2) When the form is submitted, all html input elements with the name attribute (including input tags, button tags, select tags, etc.) will be submitted as key-value pairs, except for the Submit object. The Submit object will only be submitted as a key-value pair in the submission after it is clicked.
But those who are engaged in WEB UI should note that using submit to improve the usability of the page:
After using submit, the page supports keyboard enter key operation, but many WEB software designers may not Notice that submit is unified.
After using the button, the page often does not support the enter key. Therefore, if you need to support the enter key, you must set up a submit. By default, the enter key operates on the first submit on the page.
After executing onClick, go to action. Can be submitted automatically without onClick. So onclick is not required here.
After executing onClick, the jump file is controlled in the js file. Submit requires onClick.
For example:
1. onclick="form1.action='a.jsp';form1.submit();" This realizes the submit function.
To put it more plainly, submit will have a jump and the page will refresh; but button will not refresh, it is just a button; you can use
The above is the detailed content of Introduction to the difference between button and submit. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





In HTML, you can use the width and height attributes to set the size of the button element, and use the background-color attribute to set the color of the button element. The specific syntax is "button{width: width value; height: height value; background-color: color value;}".

An error occurs when ubuntu mounts a mobile hard disk: mount: unknownfilesystemtype'exfat'. The processing method is as follows: Ubuntu13.10 or install exfat-fuse: sudoapt-getinstallexfat-fuseUbuntu13.04 or below sudoapt-add-repositoryppa:relan/exfatsudoapt-getupdatesudoapt-getinstallfuse- exfatCentOS Linux mount exfat format USB disk error solution to load extfa in CentOS

The usage of the Type keyword in Go includes defining new type aliases or creating new structure types. Detailed introduction: 1. Type alias. Use the "type" keyword to create an alias for an existing type. This alias does not create a new type, but only provides a new name for the existing type. Type aliases can improve code. The readability of the code makes the code clearer; 2. Structure type. Use the "type" keyword to create a new structure type. The structure is a composite type that can be used to define custom types containing multiple fields. etc.

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

In this guide, we will learn more about the "type" command in Linux. Prerequisites: To perform the steps demonstrated in this guide, you need the following components: A properly configured Linux system. See how to create a LinuxVM for testing and learning purposes. Basic understanding of the command line interface The Type command in Linux is different from other Linux-specific commands (for example: ls, chmod, shutdown, vi, grep, pwd, etc.). The "type" command is a built-in Bash function that is displayed as an argument. Information about the command type provided. $type In addition to Bash, other shells (Zsh, Ksh, etc.) also come with

Abstract Redis is an open source, high-performance key-value database that is widely used in various scenarios. In Redis, data type (type) and encoding (encoding) are very important concepts. This blog will introduce in detail the data types supported by Redis as well as the corresponding encoding methods and underlying implementation principles. To view the internal encoding of a Redis key, you can use the Redis command OBJECTENCODINGkey. Among them, key is the key name you want to query. For example, if you want to query the internal encoding of a key named mykey, you can execute the following command: 127.0.0.1:6379>objectencodin

Required information: 1. Email registration; 2. Mobile phone number registration; 3. Third-party social platform registration. After successful registration, you usually need to fill in some basic personal information, such as nickname, gender, birthday, etc.

1) Open the idea and start creating the SpringBoot project 2) Select SpringInitializr, select the appropriate jdk version, and click Next. When operating to the Type option, there are four project types to choose from: MavenProject (GenerateaMavenbasedprojectarchive) MavenPOM (GenerateaMavenpom.xml) GradleProject (GenerateaGradlebasedprojectarchive) )GradleConfig(GenerateaGradlebuildfile
