如果您需要在网站嵌入OA登陆框,请按照绿叶OA官方提供的接口操作。示例网页下载: /download/web_oaforoa169com.rar
新建网页:在<head></head>之间写入如下代码: <script language="javascript"> <!-- function isGBChar(string) { if (string =="") string = "0"; valid = ’0123456789abcdefghijklmnqporstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*( )_+/., \?<>;\1``-=/.,;’; for (var i=0; i< string.length; i++) { if (valid.indexOf(string.charAt(i)) == -1) { return false;} return true; } } function check(){ if(form1.u.value==""){ alert("请输入个人帐号!"); form1.u.focus(); return(false); } if(form1.p.value==""){ alert("请输入个人密码!"); form1.p.focus(); return(false); } if(form1.p.value.length<10){ alert("请输入10位以上个人密码!"); form1.p.focus(); return(false); } if ((document.form1.u.value.indexOf(",")>-1)||(document.form1.p.value.indexOf("=")>-1)||(document.form1.u.value.indexOf("=")>-1)||(document.form1.p.value.indexOf(".")>-1)||(document.form1.u.value.indexOf(".")>-1)||(document.form1.p.value.indexOf(",")>-1)||(document.form1.u.value.indexOf("’")>-1)||(document.form1.p.value.indexOf("’")>-1)||(document.form1.u.value.indexOf("’")>-1)||(document.form1.p.value.indexOf("’")>-1)||(document.form1.p.value.indexOf("?")>-1)||(document.form1.u.value.indexOf("?")>-1)||(document.form1.p.value.indexOf(";")>-1)||(document.form1.u.value.indexOf(";")>-1)||(document.form1.p.value.indexOf("=")>-1)||(document.form1.u.value.indexOf("=")>-1)||(document.form1.p.value.indexOf("+")>-1)||(document.form1.u.value.indexOf("+")>-1)||(document.form1.p.value.indexOf("-")>-1)||(document.form1.u.value.indexOf("-")>-1)||(document.form1.p.value.indexOf("&")>-1)||(document.form1.u.value.indexOf("&")>-1)||(document.form1.p.value.indexOf("/")>-1)){ alert("请勿输入非法字符!")
return false; } return(true); } //--> </script>
放置一个表格,嵌入一个form表单,在form表单中插入一个3行2列的表格。 表单元素: 文本框 名称:<input name=u id=u value="" > 密码框 名称:<INPUT name=p type=password id=p value="" > 登陆submit按钮 :<input name="Submit" type="submit" value="登 录"> 普通按纽: <input name="Submit2" type="button" onclick="javascript:document.location.href=’getpwd/getpd.asp’" value="忘记密码"></TD> post文件:即绿叶oa 的index.asp 文件:<form ACTION="index.asp" name="form1" method="POST" onsubmit="return check()">
示例网页下载download/web_oaforoa169com.rar 完整代码:
<html> <head> <title>绿叶OA网站接口</title> <script language="javascript"> <!-- function isGBChar(string) { if (string =="") string = "0"; valid = ’0123456789abcdefghijklmnqporstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*( )_+/., \?<>;\1``-=/.,;’; for (var i=0; i< string.length; i++) { if (valid.indexOf(string.charAt(i)) == -1) { return false;} return true; } } function check(){ if(form1.u.value==""){ alert("请输入个人帐号!"); form1.u.focus(); return(false); } if(form1.p.value==""){ alert("请输入个人密码!"); form1.p.focus(); return(false); } if(form1.p.value.length<5){ alert("请输入5位以上个人密码!"); form1.p.focus(); return(false); } if ((document.form1.u.value.indexOf(",")>-1)||(document.form1.p.value.indexOf("=")>-1)||(document.form1.u.value.indexOf("=")>-1)||(document.form1.p.value.indexOf(".")>-1)||(document.form1.u.value.indexOf(".")>-1)||(document.form1.p.value.indexOf(",")>-1)||(document.form1.u.value.indexOf("’")>-1)||(document.form1.p.value.indexOf("’")>-1)||(document.form1.u.value.indexOf("’")>-1)||(document.form1.p.value.indexOf("’")>-1)||(document.form1.p.value.indexOf("?")>-1)||(document.form1.u.value.indexOf("?")>-1)||(document.form1.p.value.indexOf(";")>-1)||(document.form1.u.value.indexOf(";")>-1)||(document.form1.p.value.indexOf("=")>-1)||(document.form1.u.value.indexOf("=")>-1)||(document.form1.p.value.indexOf("+")>-1)||(document.form1.u.value.indexOf("+")>-1)||(document.form1.p.value.indexOf("-")>-1)||(document.form1.u.value.indexOf("-")>-1)||(document.form1.p.value.indexOf("&")>-1)||(document.form1.u.value.indexOf("&")>-1)||(document.form1.p.value.indexOf("/")>-1)){ alert("请勿输入非法字符!")
return false; } return(true); } //--> </script> </head> <body> <table width="398" border="0" cellspacing="0" cellpadding="0"> <tr> <td><form name="form1" method="post" action="index.asp" onsubmit="return check()"> <table width="358" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="80"><div align="right">用户名:</div></td> <td width="278"><input name=u id=u ></td> </tr> <tr> <td width="80"><div align="right">密码:</div></td> <td><INPUT name=p type=password id=p ></td> </tr> <tr> <td><div align="right"></div></td> <td><input name="Submit" type="submit" value="登 录"> <input name="Submit2" type="button" onclick="javascript:document.location.href=’getpwd/getpd.asp’" value="忘记密码"></td> </tr> </table> </form></td> </tr> </table> </body> </html>
技术支持:南昌绿新软件技术有限公司 电话:0791-8839172 email:oa169@163.com 技术支持QQ:413400260
|