gvdias
(Gustavo)
January 7, 2020, 5:12pm
1
Hi all,
I’m trying to set up a simple form validation using jqueryvalidation.org
It’s a very simple plug in which uses the standard HTML attributes to validate and display custom error messages.
The issue is, the script is not triggering. It seems like Webflow is blocking it from triggering?
For reference, all the plugin asks to do is to link the js file:
<script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.1/dist/jquery.validate.min.js"></script>
And call the script referencing the form ID:
<script>
$("#myForm").validate();
</script>
But somehow webflow is not letting the script run.
Any ideas will be much appreciated!
maybe try the webflow wrapper like so:
var Webflow = Webflow || [];
Webflow.push(function () {
$("#myForm").validate();
}
Jeandcc
(Jean Costa)
January 7, 2020, 7:31pm
3
Can you please share the link to your website? That way us developers can help you out by getting our hands on it!
gvdias
(Gustavo)
January 8, 2020, 6:18pm
4
Thank you @anthonysalamin and @Jeandcc
It seems like I found the issue.
I was adding the ID to the ‘Form Block’ on Webflow, which is not a Form tag but a DIV.
To add the ID to the Form tag you need to add it to that Form element right inside the ‘Form Block’.
Hope that makes sense!
1 Like
Jeandcc
(Jean Costa)
January 8, 2020, 9:23pm
5
Awesome ! That has always annoyed me haha In my opinion, the actual form element should have a different icon isntead of the form-block that is simply a div
1 Like
gvdias
(Gustavo)
January 10, 2020, 12:38pm
6
Agree! A different icon for the form element would do the trick. Specially since the Form Block does have a different icon, so it’s a bit misleading.
1 Like