How to automatically submit a form after several seconds using jQuery

Source: Internet
Author: User

How to automatically submit a form after several seconds using jQuery

This article mainly introduces how to automatically submit a form after jQuery implements the form several seconds. The example shows how to implement the form delayed submission using jQuery. If you need it, refer

 

 

This example describes how to automatically submit a form after jqury is implemented several seconds. Share it with you for your reference. The details are as follows:

This code is set for many download websites. The Download button takes several seconds. After the Download button is complete, you can click Submit.
Easy to create:

1. Some JavaScript code is as follows:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

<Script language = 'javascript '>

<! --

$ (Document). ready (function (){

// # FormDownload ajaxForm

$ ('# FormDownload'). ajaxForm ({

Target: '# formDownloadWindows', success: function (){

}

});

});

Function jump (count, formId ){

Window. setTimeout (function (){

Count --;

If (count> 0 ){

Condition ('{jumpnum'{.html (count );

Jump (count, str );

} Else {

$ (Str). submit ();

}

},1000 );

}

// -->

</Script>

2. Some HTML code is as follows:

?

1

2

3

4

<Form action = "/action/download" method = "post" id = "formDownload">

Wait <span id = "jumpNum"> </span> seconds

<Input type = "button" onclick = "jump (30," # formDownload ");"/>

</Form>

I hope this article will help you with jQuery programming.

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.