Reputation: 23
I'm using parlsey validation and all is good. The problem is that if you partially load the website or load the website and click on "send" before everything is loaded, then parsley validation does not work.
Its not working because it hasn't been loaded. However, the validation script for parsley is in the header of the document? Is there a way to load a script before the website is loaded at all?
Upvotes: 0
Views: 469
Reputation: 6111
No that's not possible. If you place the JavaScript src in the head of the HTML document that's moste likely the only thing you can do. But that's not a good idea at all. JavaScript has to be placed before the closing body tag - at least until all Browsers and Servers are using SPDY.
The problem you are facing is caused by the way parsley works. While loading the page it will "scan" the HTML markup and search for parsley validation informations and apply bindings to them. It seems that this is not fully done.
What you can do is trying to avoid hitting a submit or what you use for submitting a form before the domready event is available. You could eg. set a submitt button for the form to disabled ...
Upvotes: 3