You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a fault with Url constraint. Every time I type a character into a URL field, it prepends http:// so I end up with http://http://http://http://http://http://http://thestartofmyurl etc.
It looks like it is simply because there is no check to see if it's already prefixed http://.
The text was updated successfully, but these errors were encountered:
There is the following, which checks if the regex is matched, and if it is not, it prefixes the input field's value with http://.
if(!f.isValueEmty(value)&&!regexp.test(value)){element.domNode.value='http://'+value;errors.push(this.message.replace('{{ value }}',FpJsBaseConstraint.formatValue('http://'+value)));}
What I did forget to mention is my validation is triggered onkeyup, so the validation does not run once on submit, but repeatedly as the user enters the URL.
The above code blindly adds the http:// prefix even if it's already present, so you get multiple prefix strings with every keypress.
I think we need an additional check to see if the prefix already exists, and to not add it if it does. Would you agree? Happy to submit a PR if necessary.
There is a fault with
Url
constraint. Every time I type a character into a URL field, it prependshttp://
so I end up withhttp://http://http://http://http://http://http://thestartofmyurl
etc.It looks like it is simply because there is no check to see if it's already prefixed
http://
.The text was updated successfully, but these errors were encountered: