Recommended: Talking about the copying of objects The following is the referenced content: <%Dim oConn,oRsSet oConn = Server.CreateObject(ADODB.Connection)Set ors = Server.CreateObject(ADODB.R
Before submitting a form, we usually use client JS to verify its content. Usually, we write a function and call it in the onsumbit event, as follows:
The following is the quoted content: <html> <head> <script language=javascript> function check() { if(form1.aaa.value == ){return false;} if(form1.bbb.value == ){return false;} return true; } </script> </head> <body> <form id=form1 name=form1 method=post action=default.asp onsubmit=return check();> <p> <input name=aaa type=text id=aaa /> </p> <p> <input name=bbb type=text id=bbb /> </p> <p> <input type=submit name=Submit value=submit/ </p> </form> </body> </html> |
So if you use multiple functions to verify the form, how should you write the function and how to call it? Actually, it's very simple, as shown in the following example:
The following is the quoted content: <html> <head> <script language=javascript> function check1() { if(form1.aaa.value == ) { return false; }else{ return true; } } function check2() { if(form1.bbb.value == ) { return false; }else{ return true; } } </script> </head> <body> <form id=form1 name=form1 method=post action=default.asp onSubmit=return (check1() && check2());> <p> <input name=aaa type=text id=aaa /> </p> <p> <input name=bbb type=text id=bbb /> </p> <p> <input type=submit name=Submit value=submit/ </p> </form> </body> </html> |
Original text: http://www.mzwu.com/article.asp?id=1078
Share: ASP instance: Using cache to improve data display efficiency Example demonstration: First create a simple database, write a function to read it, and write a dim variable temp: The following ASP code is the referenced content: <% Function DisplayRec