Paging jump (check for numbers and carriage return jumps)

Source: Internet
Author: User

Check whether the numbers match

Function anp_checkinput (BID, MV)

{

VaR El = Document. getelementbyid (BID );

VaR r = new Regexp ("^ \ s * (\ D +) \ s * $ ");
If (R. Test (El. Value )){

If (Regexp. $1 <1 | Regexp. $1> mV ){

Alert ("the page index is out of range! ");

El. Focus ();

El. Select ();

Return false;

}
Return true;

}

Alert ("the page index is not a valid value! ");

El. Focus ();

El. Select ();

Return false;

}

 

Press enter to jump

Function anp_keydown (E, btnid ){
VaR kcode;
If (window. Event) {kcode = E. keycode ;}
Else if (E. Which) {kcode = E. Which ;}
VaR validkey = (kcode = 8 | kcode = 46 | kcode = 37 | kcode = 39 | (kcode> = 48 & kcode <= 57) | (kcode> = 96 & kcode <= 105 ));
If (! Validkey ){
If (kcode = 13) document. getelementbyid (btnid). Click ();
If (E. preventdefault) E. preventdefault (); else {event. returnvalue = false };
}
}

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.