Last active
May 28, 2024 13:57
-
-
Save dan-donica/bb9aca22f81aa7830e696b71695e40c2 to your computer and use it in GitHub Desktop.
HC || Remove email/number validation on selected fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Begin "Remove number validation on selected fields" || Help center --> | |
<!-- Add to Settings->Javascript->Footer --> | |
<!-- CS:20200929-25-1 --> | |
<script> | |
var remove_validation = ['Number one', 'Number Two']; | |
setTimeout(function(){ | |
Object.keys(window.__validators).forEach(function (item) { | |
Object.keys(window.__validators[item].inputs).forEach(function (input) { | |
remove_validation.forEach(element => { | |
if (input == element) { | |
if (window.__validators[item].inputs[element].length == 2) { | |
var key_to_delete = 1; | |
} | |
if (window.__validators[item].inputs[element].length == 1) { | |
var key_to_delete = 0; | |
} | |
delete window.__validators[item].inputs[element][key_to_delete]; | |
} | |
}); | |
}); | |
}); | |
}, 1000); | |
</script> | |
<!-- End "Remove email/number validation on selected fields" || Help center --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment