1

What I want is to submit a form in the background, so that it doesn't redirect to the form "action." Is there a clean way to do this, without using external libraries like jQuery?

Anonymous1847
  • 2,568
  • 10
  • 16
  • You are looking for ajax. Check this: http://stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery – Dekel Dec 19 '16 at 22:30

1 Answers1

0

No. If you submit a form, you will redirect.

What you can do, however, is to "serialize" the form, get the URL (I'm assuming GET), and request the server using XmlHttpRequest (Ajax).

There's a question on SO about serializing a form without jQuery: how to serialize a form without jQuery?

Also, this one on how to use XMLHttpRequest: How to get the response of XMLHttpRequest?

jQuery kind of makes both tasks easier, though

Community
  • 1
  • 1
Andre Pena
  • 56,650
  • 48
  • 196
  • 243