简体   繁体   中英

Submit form from javascript with form url

I have a button. And I have a form that calls celery task. form has url, smth like

http://example.com/export/?user=user123&timedelta=10

I need to submit this form from confirm dialog.
How it should work... In user profile admin presses a button, javascript confirmation appears, admin clicks ok and the form from this url should be submitted. I'm sooo new to javascript and frontend programming. I need your help.

使用jQuery Submit()

$('#yourFormID').submit();

Try this

    var r=confirm("Press a button");
        if (r==true)
          {

//Form is on another page so
window.location="your_url_withquerystring"
          }
        else
          {

          }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM