Program Name: IP Address Enterprise V1.0
Completion time: March 1, 2004
Servers: wild horses
Function: The input box pattern completely simulates the Windows IP input box, automatically verifies the input content, automatically rotates.
Contact: email: woaini4651@yahoo.com.cn QQ: 46163020
->
Function outst () {
IF (Document.all.ip1.value> 0 && Document.All.ip2.Value> 0 && Document.all.ip3.Value> 0 && Document.all.ip4.value> 0) {
Alert ("The IP address you entered is:" Document.All.ip2.value "." Document.all.ip3.value "." Document. All.ip4.value;
} // end if
} // end
Function Moveright (obj) {
ID = parseint (obj.name.substr (2, 1))
IF (id <4) {
EVAL ("Document.all.ip" (ID 1) ".focus ()");
} else {
Outstr ();
} // end if
}
Function moveeft (obj) {
ID = parseint (obj.name.substr (2, 1))
IF (id> 1) {
EVAL ("Document.all.ip" (ID -1) ".focus ()");
} // end if
} // end if
Function KeyPress (OBJ) {
Var objinput = OBJ;
COD = Window.Event.Keycode;
IF (COD == 46 && (Obj.Value) .length> 0) {// If you press "." and have a character, move right to the right.
Window.event.keycode = 0;
Moveright (OBJ);
} else if ((obj.value) .length == 2 && (COD> = 48) && (COD <= 57)) {// If the number key is 2
IF (COD <58) {////
Obj.value = obj.value * 10 COD - 48;
} // end if
Window.event.keycode = 0;
Moveright (OBJ);
} ELSE {// Judgment input is not a number
IF (((((COD> = 48) && (COD <= 57)) || (COD == 13) || (COD == 37) || (COD == 39))) {Window.event. Keycode = 0;
} // end if
} // end if
} // end function keydown
Function getCaretPos (OBJ) {
Var curritrange = document.selection.createRANGE ();
Var Workrange.duplicate ();
Obj.select ();
Var allrange = document.selection.createrange ();
VAR LEN = 0;
While (WorkRange.comPareEndpoints ("StartTostart", AllRange> 0) {
Workrange.MoveStart ("Character", - 1);
Len ;
}
CurrentRange.select ();
Return Len;
} // end
Function KeyDown (OBJ) {
COD = Window.Event.Keycode;
i = getCareTPOS (OBJ); / / cursor location
n = obj.value.length; // Character length
IF (COD == 37 && I == 0) {// Cursor left shift
Moveleft (OBJ);
} else if (COD == 39 && I> = n) {
Moveright (OBJ);
Else if (COD == 8 && (Obj.value == "|| i == 0)) {
Moveleft (OBJ);
} // end if
} // end
Function checkdate (Obj, max_num) {
IF (Obj.Value> max_num || obj.value <0) {
Window.event.keycode = 0;
Alert (obj.value "is an invalid project, only the number between 0 and" max_num ".");
Obj.value = max_num;
Obj.focus ();
Obj.select ();
} // end if
} // end
script>
Body {
Background-color: # d6d3ce;
Border: 0px none;
}
->
stop> head>