简体   繁体   English

使用表格网址从JavaScript提交表格

[英]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. 它应该如何工作...在用户个人资料中,admin按下按钮,出现javascript确认,admin单击“确定”,并且应提交该URL中的表格。 I'm sooo new to javascript and frontend programming. 我对javascript和前端编程非常陌生。 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
          {

          }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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