JavaScript-4.7-friendly_table---ShinePans

来源:互联网 发布:淘宝联盟隐藏计划 编辑:程序博客网 时间:2024/05/21 09:21
<html><head><meta http-equiv="content-type" content="text/html;charset=GB2312"/><title> 4.6 人性化表单 </title><!--脚本部分--><script type="text/javascript">function $(str) {return(document.getElementById(str));}function check_submit(){if($("txt_user_name").value==""){alert("请填写用户名");return(false);}if($("txt_user_pass").value==""){alert("请输入密码");return(false);}if($("txt_user_pass_confirm").value=="") {alert("请输入确认密码");return(false);}$("submit_button").disabled=true;return(false);}function mover(){event.srcElement.focus();event.srcElement.select();}function mblur(){if(event.srcElement.value=="") event.srcElement.value="[输入用户名]";}function mclick(){if(event.srcElement.value=="[请输入用户名]") event.srcElement.value="";}</script></head><body style="overflow:auto;"><form action="" onsubmit="return check_submit();">用户名: <br><input id="txt_user_name" onmouseover="mover();onclick="mclick();" onblur="mblur();" value="[请输入用户名]"><br>密码: <br>  <input id="txt_user_pass" type="password" onmouseover="mover();" value="默认密码"><br>  确认密码:<br>  <input id="txt_user_pass_conform" type="password" onmouseover="mover();" value="默认密码"><br>  <input type="submit" calue="提交" id=submit_button"></form></body></html>




5 0