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
This article example shares the specific code of ...
Assume there are two Linux servers A and B, and w...
1. View the current host name [root@fangjian ~]# ...
introduction The previous article introduced the ...
Table of contents Animation Preview Other UI Libr...
1. What is positioning? The position attribute in...
Use CSS to modify scroll bars 1. Overflow setting...
Table of contents 1- Error details 2-Single Solut...
Table of contents 1.1 Java environment as a prere...
Table of contents 1. Gojs Implementation 1. Drawi...
As shown below: select name from mysql.proc where...
Overview Databases generally execute multiple tra...
If we introduce the nesting rules of basic HTML w...
Some time ago, the project needed to develop the ...
Result:Implementation Code html <link href=...