Copy code 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> I don't want to use a button to submit the form, I want to use a better-looking image to submit If you write it like that, it will be submitted twice, once by the input itself, and once by the js script. There are several ways to use an image as a submit button: 1. Copy code The code is as follows:<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> As the author himself wrote, this is completely possible. 2. Copy code The code is as follows:<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> This method is often used in mixed programming, such as when the parameters you want to submit change with the dynamically retrieved content. |
<<: Vue implements small notepad function
>>: Solution to installing vim in docker container
1. The three files /etc/hosts, /etc/resolv.conf a...
Table of contents 1. Static implementation method...
Sometimes the page is very long and needs an arro...
Table of contents Multiple conditional statements...
Web Server 1. The web server turns off unnecessar...
mysql create table sql statement Common SQL state...
Table of contents Overview 1. useState 1.1 Three ...
You may encounter the following problems when ins...
<br />Previous tutorial: Web Design Tutorial...
Table of contents Import on demand: Global Import...
Say it in advance Nodejs reads the database as an...
Background: Linux server file upload and download...
JavaScript to achieve the source code download ad...
This article shares the specific code for impleme...
Mybatis paging plug-in pageHelper detailed explan...