If there is an <input type="image"> here, then pressing this image directly will submit the form. If there is OnSubmit, this function will be executed first. If it returns false, the form will not be submitted! Copy code The code is as follows:<span style="font-size:14px;"><script language=javascript> function test() { alert("Test!") } </script> <form name="F1" onSubmit="fuck();"> <input type="image" src="" width="51" height="20"> </form></span> Another example: Copy code The code is as follows:<html> </head> <script language="javascript"> function checkEmpty(form){ for(i=0;i<form.length;i++){ alert(form.elements[i].value); if( form.elements[i].value=="" ){ alert("Form information cannot be empty"); return false; } } } </script> <body> <form name="form" method="post" onSubmit="return checkEmpty(form)"> <input name="name" type="text" size="17"> <input name="password" type="password" size="17"> <input type="image" src="" width="51" height="20"> <input type="button" value="AAA" /> </form> </body> <html> |
<<: Summary of pitfalls of using nginx as a reverse proxy for grpc
>>: Several methods of implementing two fixed columns and one adaptive column in CSS
This article shares the installation and configur...
Open any web page: for example, http://www.baidu....
Written in front Weibo components are component p...
1. Introduction I have been studying the principl...
Problem Description The MySQL startup error messa...
Text carousels are very common in our daily life....
The requirements are as follows: There are multip...
This article mainly summarizes some commonly used...
Table of contents Preface Rendering setTable comp...
This article example shares the specific code of ...
Today I found this prompt when I was running and ...
On the server, in order to quickly log in to the ...
By default, Docker runs over a non-networked UNIX...
function 0. Display current time Command: select ...
This article shares the specific code of JavaScri...