The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

address validator required field before submit

Labels

This Discussion is public

Notifications

Hi guys, I am working on a form with formidable forms, where I am using an address validator, all is good and works fine. But I can not figure out how to make the address validator required. Any ideas???

This could be done either with hiding the submit button or by making it requried to use the address validator and chose and address

I was thinking about using the fields the address populate that is hidden for users, but that is not working, and now I have been working with a script

<script>
document.addEventListener('DOMContentLoaded', function(){
var submit = document.querySelector('#form_s2ggbm input[type="submit"]');
submit.style.visibility = "hidden";
document.getElementById("field_iu6mlk").addEventListener("input", function(){
submit.style.visibility = "";
});
});
</script>

The s2ggbm is the form key and the iu6mlk is the field key, this hides the submit button like I wanted but it does not show the submit button again as soon the field is populated from the address validator... In my case I used postcode2 field in the script (this is where the postcode is added from the validator)

Any one with a suggestion? You can see the form here http://wordpress-63608-239519.cloudwaysapps.com/

I placed the script in after keys field no luck and I have tried to place it in the submit button field but no luck either...

Any help would be much appreciated...

Discussion closed.