I have a Wordpress based website that uses gravity forms. I have the gravity form loading in a jquery model window. My issue is the form seems to work except for after submission the form just stays on the screen and I see the below error in the console.

Uncaught DOMException: Failed to set the 'href' property on 'Location': 'http://' is not a valid URL.

I am not sure why this error would occur and how http:// not be a valid url

  • http:// all by itself is not a valid URL. If GravityForms is trying to redirect (and I think it is; the Location: header is used for redirection) and the URL it's trying to redirect to is simply http:// and not, say, http://example.com/redirect-here, then yes, it would fail. Hopefully this helps; if not, you'll need to take this up with GravityForms' official support.
    – Pat J
    Jun 18, 2020 at 16:14

2 Answers 2


To answer your question, http:// is the protocol with which the thing requested is to be obtained. The stuff after the :// is the location at which the thing requested is located. In order to be a valid Uniform Resource Location, you need to provide the location at which the thing requested resides, not just the protocol used to obtain the thing.

So, if you want to use the HyperText Transfer Protocol to retrieve some hypertext (encodement in HyperT Markup Language) located at www.example.com/myfile.html, your URL must be http://www.example.com/myfile.html.

With that said, I would first check the URL that you are sending with your form (if any). If that doesn't work, you will have to trace the code (and your submission) to determine if a proper URL is being generated within the plugin to find the offending code or you are likely to continue getting that error. Or, you could try contacting Gravity Forms which is likely to be a better option because they are the ones who are responsible for writing the code.


Thank you all. So I had the gravity form confirmation set to text but had no content in the wysiwyg. When I added content it seemed to fix the issues. So it seems if in gravity forms you have text set as the confirmation but then don't put any text it tries to load a url by default.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.