This article provides you with a prevention of repeated submission of Web page special effects code Oh, you can prevent users from constantly click to submit the form, we will only submit once oh.
<html xmlns= "http://www.jzread.com/1999/xhtml" > <head runat= "Server" > <script type= "text/web Effects" > var date = new Array (); function Disablebutton (button, Validategroup) { Date.push (new Date ()); if (Date.length > 1 && (Date[date.length-1].gettime ()-Date[date.length-2].gettime () < 1000)//less than 1 seconds is considered duplicate commit { Event.cancelbubble = true; Test found that if directly set cancelbubble, or ReturnValue to cancel the event, often canceled, there is still the possibility of duplicate submissions. So we have to use the return value to achieve manual control! return false; } if (typeof (page_clientvalidate) = = ' function ' && ((Validategroup = = undefined && page_clientvalidate () = False) || (Validategroup!= undefined && page_clientvalidate (validategroup) = False)) {//If Validategroup is specified, only the reorganization is validated; if not specified, validate all validation controls return false; }
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.