0

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.

3
  • 1
    I'd read: api.jquery.com/submit and have a look at w3schools.com/js/js_popup.asp Commented Jan 24, 2013 at 10:22
  • 1
    @CharliePrynn I wouldn't look at anything on w3schools, since they have a habit of putting up information that is flat out wrong. Go for something that's actually reliable, such as the Mozilla Developer Network. Commented Jan 24, 2013 at 10:32
  • @AnthonyGrist Fair enough. Can't say I've used it in great detail myself so I have not noticed. Commented Jan 24, 2013 at 11:44

2 Answers 2

1

use jquery submit()

$('#yourFormID').submit();
Sign up to request clarification or add additional context in comments.

4 Comments

Something people usually forget when using this: Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method.
but... how to make a call to a form that is not on this page?
not on this page... u mean your foem is somewhere and conformation is somwwhere.. not getting you
I have a page with a button... and have another page that should be submitted... literally, I should submit a form from another form via url))) a bit complicated))
0

Try this

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

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

          }

1 Comment

hm... that is similar to what I need))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.