document.writeln(" <form action=\"/login.aspx?act=login\" method=\"post\" name=loginForm>");
document.writeln(" 用户名:<input name=\"Username\" class=\"borderall\" type=\"text\" size=\"15\" style=\"width:100px;height:15px;\">");
document.writeln(" 密 码:<input name=\"PassWord\" class=\"borderall\" type=\"password\" size=\"15\" style=\"width:100px;height:15px;\">");
document.writeln(" <input type=\"checkbox\" name=\"CookieDate\" id=\"CookieDate\" style=\"border:0;\"\/>保存");
document.writeln(" <input type=\"submit\" name=\"Submit\" value=\"登录\" class=\"borderall\" style=\"height:19px;\"\/>");
document.writeln(" <\/form>");
因为ASPX页面已有Form,这么写会提交ASPX页面的FORM,所以只能通过document.getElementById("loginForm").submit();
提交,但是调试时发现loginForm的ID无法获取。
求各位大神帮帮忙。
------解决方案--------------------
加个id就可以了.
document.writeln(" <form id='loginForm' action=\"/login.aspx?act=login\" method=\"post\" name=loginForm>");
