buttons to submit a form

After attending an HTML class, your first excise to submit an html form must be using a <input type=”submit”> button. Clicking the button will submit the values in the form to the server. If you addict to the “input” element of “submit” type for submitting a form, you must be confused about the following code:

<input type="image" src="/button.png">

This is an image button. If you click on it, you’ll see the form is submitted. How could this happen? In fact, there are quite a few ways to submit html forms including using an “input” element of “image” type. If you do not know it, you must be finding the js code that binds the click event handler to the image button. Until you can not find the click event handing function will you realize that the image input itself is enough to submit the form. Other elements that can submit a form include a button element(without a type attribute). Note that the following buttons will not trigger the submission of a form:

<input type="button">
<button type="button">clickme</button>

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Comments are closed, but trackbacks and pingbacks are open.