Copy codeThe Code is as follows: <script language = "javascript">
Function showlist (vtype)
{
With (document. listform)
{
W_type.value = vtype;
}
Document. listform. submit ();
Return;
}
Function showout (vid)
{
With (document. showform)
{
Id. value = vid;
}
Document. showform. submit ();
Return;
}
Function showmenu (buyok, img)
{
If (buyok. style. display = "none ")
{
Buyok. style. display = "";
Img. src = "images/bclass2.gif ";
} Else {
Buyok. style. display = "none ";
Img. src = "images/bclass1.gif ";
}
}
</SCRIPT>
<Script language = "JavaScript">
Function page (vpage ){
Document. pageform. page. value = vpage;
Document. pageform. submit ();
Return false;
}
Function trimpos (s ){
Return s. replace (/(^ [\ s] *) | ([\ s] * $)/g ,"");
}
Function isnum (tmp ){
If (tmp> = '0' & tmp <= '9 ')
Return true;
Return false;
}
Function mysubmit (){
If (event. keyCode = '13 ')
Gosubmit ();
}
Function gosubmit (){
Var str = trimpos (vpos. value );
If (str = ""){
Alert ("Enter the page number! ");
Vpos. focus ();
Return;
}
For (var I = 0; I <str. length; I ++ ){
If (isnum (str. charAt (I) = false ){
Alert ("the page number must be composed of numbers! ");
Vpos. focus ();
Vpos. value = "";
Return;
}
}
If (parseInt (str) <1) | (parseInt (str)> 2 )){
Alert ("the page number is out of the range! ");
Vpos. focus ();
Vpos. value = "";
Return;
}
Page (str );
}
</Script>