SoFunction
Updated on 2025-02-28

A question that has been omitted, about repeated submission of forms


JSCRIPT when making login judgment in the home page:

The following is the code:
Copy the codeThe code is as follows:

<script language="JavaScript"> 
<!-- 
function checkform(){ 
if (form1.Fs_UserName.value ==""){ 
alert("Please enter the user name!");
  form1.Fs_UserName.focus(); 
  return false;} 
if (form1.Fs_UserPass.value ==""){ 
alert("Please enter the user password!");
   form1.Fs_UserPass.focus(); 
   return false;} 

(); 

//--> 
</script> 




In the past, I only recorded it in the database and it was not displayed on the page in the end. However, when I was doing login records recently, I found that many records had the same one. I was depressed~ My FORM ACTION sentence is:

  <form name="form1" action="?Sid=<%=%>" method="post"  onSubmit="return checkform()">

There is one () during the detection, and form has another action, so it was submitted twice.

Change the code and change (); in JSCRIPT to come true; The problem has been solved.

-->>Details determine success or failure! Do the small things around you well and do it well!