Home Web Front-end HTML Tutorial How to use image to submit form

How to use image to submit form

Feb 10, 2018 am 09:48 AM
form image submit

This time I will show you how to use image to submit form, what are the precautions to use image to submit form, the following is a practical case, let's take a look.

The code is as follows:

<form method="post" action="formtest.html" target="_blank" name="formtest"> 
<input type="hidden" name="userid" value="userid"> 
<input type="hidden" name="username" value="username"> 
<input type="image" src="imagesubmit.gif" border="0"> 
</form>
Copy after login

I don’t want to use a button to submit the form, I want to use a nicer image to submit it

That way it will be submitted twice, the input itself is submitted once, and the js script is submitted again Submit once
Use
picture as the submit button. There are several methods as follows: 1.

<form method="post" action="formtest.jsp"> 
<input type="hidden" name="userid" value="userid"> 
<input type="hidden" name="username" value="username"> 
<input type="image" src="imagesubmit.gif" border="0"> 
</form>
Copy after login

Just as the original poster wrote, this is completely Yes

2.

<script> 
function formsubmit(){ 
document.formtest.action="formtest.jsp"; 
document.formtest.submit(); 
} 
</script> 
<form method="post" name="formtest"> 
<input type="hidden" name="userid" value="userid"> 
<input type="hidden" name="username" value="username"> 
<img src="imagesubmit.gif" border="0" onclick="formsubmit()"> 
</form>
Copy after login

This method is often used in hybrid

ProgrammingIf the parameters you want to submit change with the dynamically retrieved content

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to implement HTML-like command line interface

How to implement list loop with html+css+javascript Scroll

How to use button trigger to achieve background color flash

The above is the detailed content of How to use image to submit form. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MySQL transaction processing: the difference between automatic submission and manual submission MySQL transaction processing: the difference between automatic submission and manual submission Mar 16, 2024 am 11:33 AM

MySQL transaction processing: the difference between automatic submission and manual submission. In the MySQL database, a transaction is a set of SQL statements. Either all executions are successful or all executions fail, ensuring the consistency and integrity of the data. In MySQL, transactions can be divided into automatic submission and manual submission. The difference lies in the timing of transaction submission and the scope of control over the transaction. The following will introduce the difference between automatic submission and manual submission in detail, and give specific code examples to illustrate. 1. Automatically submit in MySQL, if it is not displayed

How to use Bing Image Creator for free How to use Bing Image Creator for free Feb 27, 2024 am 11:04 AM

This article will introduce seven ways to get high-quality output using the free BingImageCreator. BingImageCreator (now known as ImageCreator for Microsoft Designer) is one of the great online artificial intelligence art generators. It generates highly realistic visual effects based on user prompts. The more specific, clear, and creative your prompts are, the better the results will be. BingImageCreator has made significant progress in creating high-quality images. It now uses Dall-E3 training mode, showing a higher level of detail and realism. However, its ability to consistently produce HD results depends on several factors, including fast

How to delete images from Xiaomi phones How to delete images from Xiaomi phones Mar 02, 2024 pm 05:34 PM

How to delete images on Xiaomi mobile phones? You can delete images on Xiaomi mobile phones, but most users don’t know how to delete images. Next is the tutorial on how to delete images on Xiaomi mobile phones brought by the editor. Interested users can come and join us. Let's see! How to delete images on Xiaomi mobile phone 1. First open the [Album] function in Xiaomi mobile phone; 2. Then check the unnecessary pictures and click the [Delete] button in the lower right corner; 3. Then click [Album] at the top to enter the special area , select [Recycle Bin]; 4. Then directly click [Empty Recycle Bin] as shown in the figure below; 5. Finally, directly click [Permanent Delete] to complete.

Imagemagic installation Centos and Image installation tutorial Imagemagic installation Centos and Image installation tutorial Feb 12, 2024 pm 05:27 PM

LINUX is an open source operating system. Its flexibility and customizability make it the first choice of many developers and system administrators. In the LINUX system, image processing is a very important task, and Imagemagick and Image are Two very popular image processing tools, this article will introduce you to how to install Imagemagick and Image in Centos system, and provide detailed installation tutorials. Imagemagic installation Centos tutorial Imagemagick is a powerful image processing toolset, which can perform various image operations under the command line. The following are the steps to install Imagemagick on Centos system: 1

Tips for implementing form validation and submission with PHP and UniApp Tips for implementing form validation and submission with PHP and UniApp Jul 06, 2023 am 10:57 AM

Tips for implementing form validation and submission with PHP and UniApp Introduction: When developing web pages or mobile applications, form validation and submission are essential functions. Form validation is used to check whether the data entered by the user conforms to specific rules, and submission saves or sends the data entered by the user to the server. This article will introduce the techniques of using PHP and UniApp to implement form validation and submission to help developers quickly implement front-end and back-end interaction functions. 1. PHP implements form validation. The following is a PHP form validation sample code for

Getting Started with Java Git: Exploring Version Control from Scratch Getting Started with Java Git: Exploring Version Control from Scratch Feb 23, 2024 am 10:25 AM

Introduction to git Git is a distributed version control system, which means that each developer has a complete copy of the code base on their computer. This is different from a centralized version control system (such as Subversion or Perforce), which only has a central code repository. The benefit of distributed version control is that it makes collaboration more efficient because developers can work offline and synchronize with the central code base later. Installing Git To use Git, you need to install it on your computer first. You can download the installer for your operating system from the official Git website. After the installation is complete, you can enter git --version in the command line to check whether the installation was successful. Git basic concepts repository: Git

How to handle complex form submission in Vue How to handle complex form submission in Vue Oct 15, 2023 pm 03:42 PM

How to handle complex form submissions in Vue requires specific code examples. In Vue, to handle complex form submissions, you can use Vue's form processing methods and other related plug-ins or features to simplify the development process. This article will introduce how to use Vue and some other common plug-ins to handle complex form submissions, and provide specific code examples. 1. Two-way binding of form data One of the core features of Vue is the two-way binding of data. In form processing, we can use Vue instructions to achieve bidirectional communication between form data and views.

How to handle form data verification and submission in Vue technology development How to handle form data verification and submission in Vue technology development Oct 09, 2023 am 08:12 AM

How to handle form data verification and submission in Vue technology development In Vue technology, processing form data verification and submission is a common and important task. In actual development, we often need to verify the form data entered by the user to ensure that it meets the specified format requirements and can be safely submitted to the back-end server. The following will introduce a common method of processing form data verification and submission, and provide specific code examples. Data verification in Vue, we can use the Vuelidate plug-in for form data

See all articles