Intelligent humanized submission form JS special effects code
WBOY
Release: 2016-07-25 09:06:16
Original
1357 people have browsed it
Humanized code
Web Resource Code Station Tips: Test the intelligent humanized submission form js special effects code. Check the effect of this code - it is necessary to refresh due to loading JS -
will automatically determine the humanized form with the focus of the form. When you move the mouse When you put it on an input box, it will be automatically selected without you having to click the mouse. Friends who often fill out forms will definitely like this small function, because friends who often fill out forms will face forms all day long. I wish the form could be a little smarter.
Intelligent humanized submission form JS special effects code
function $(str){ return(document.getElementById (str)); }
function check_submit(){
if($("txt_user_name").value==""){ alert("Please fill in the username"); return(false); }
if($( "txt_user_pass").value==""){ alert("Please fill in the password"); return(false); }
if($("txt_user_pass_confirm").value==""){ alert("Please fill in the confirmation Password"); return(false); }
$("submit_button").disabled=true;
return(false);
}
function mover(){
event.srcElement.focus();
event.srcElement. select();
}
function mclick(){
if(event.srcElement.value=="[Please enter user name]")event.srcElement.value="";
}
function mblur(){
if (event.srcElement.value=="")event.srcElement.value="[Please enter username]";
}
Username:
onclick ="mclick();" onblur="mblur();" value="[Please enter username]">
Password:
Confirm password:
< ;p>Web page resources-Web page code station - the most professional web code download website - dedicated to providing Chinese webmasters with Quality web code!