Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated netteForms.js to conform with PHP validation #174

merged 1 commit into from Feb 6, 2018

Updated netteForms.js to conform with PHP validation #174

merged 1 commit into from Feb 6, 2018


Copy link

@hubipe hubipe commented Jan 24, 2018

  • bug fix? yes
  • new feature? no
  • BC break? no

JS validation in netteForms.js of FLOAT rule has been thrown, if value in input field contained more than 1 space, because String.replace(string, ...) replaces only first occurrence of given string. PHP method Validator::validateFloat on the other hand uses PHP method str_replace, which replaces all occurances of space in the input value (

I updated the JS String.replace inputs to replace all occurrences in the input value, not just first one. I also updated the regexp itself to be the same as the implementation in PHP (

Copy link

@dg dg commented Feb 6, 2018


@dg dg merged commit ba7d929 into nette:master Feb 6, 2018
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants