An example of an essay-js written as an object

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Automatically select text </title>
<script type= "Text/javascript" >
var formutil = new Object ();
Formutil.settextboxs = function () {
var colinputs = document.getelementsbytagname_r ("input");
for (Var i=0;i<colinputs.length;i++) {
if (colinputs[i].type== "text" | | colinputs[i].type== "password") {
Colinputs[i].onfocus = function () {this.select ();};
}
}
}


Switch------------Brake to one of the input boxes-------------------------------------------------------
Formutil.tabforward = function (Otextbox) {

var oevent = window.event;
var oform = Otextbox.form;

cannot be the last element, and a carriage return event is triggered
if (oform.elements[oform.elements.length-1]!= otextbox && oevent.keycode = = 13) {
for (Var i=0;i<oform.elements.length;i++) {
if (oform.elements[i] = = Otextbox) {
for (Var j=i+1;j<oform.elements.length;j++) {
if (Oform.elements[j].type = = "Text") {
Oform.elements[j].focus ();
return;
}
}
return;
}

}
}
};


</script>
<body onload= "Formutil.settextboxs (); >
<!--<input type= "text" id= "target01" onkeydown= "if (event.keycode==32) return false"/>-->
<form name= "Form1" >
<table>
<tr><td><input type= "checkbox"/> title 1</td><td><input type= "text" id= "text_01" style = "Text-align:right" value= "123456789" onkeyup= "return Formutil.tabforward (this);" /></td><td><input type= "text" id= "text_02" style= "Text-align:right" value= "123456789" onKeyUp= " Return Formutil.tabforward (this); " /></td></tr>
<tr><td><input type= "checkbox"/> title 2</td><td><input type= "text" id= "text_03" style = "Text-align:right" value= "123456789" onkeyup= "return Formutil.tabforward (this);" /></td><td><input type= "text" id= "text_04" style= "Text-align:right" value= "123456789" onKeyUp= " Return Formutil.tabforward (this); " /></td></tr>
<tr><td><input type= "checkbox"/> title 3</td><td><input type= "text" id= "text_05" style = "Text-align:right" value= "123456789" onkeyup= "return Formutil.tabforward (this);" /></td><td><input type= "text" id= "text_06" style= "Text-align:right" value= "123456789" onKeyUp= " Return Formutil.tabforward (this); " /></td></tr>
</table>
</form>
</body>

An example of an essay-js written as an object

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.