-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add name field validation #984
Add name field validation #984
Conversation
tests: { | ||
'int': new RegExp(/^[\-+]?\d+$/), | ||
'float': new RegExp(/^([\-+]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([\-+]?\d+))?$/), | ||
password: new RegExp(/^\S{6,32}$/), | ||
required: new RegExp(/(.|\s)*\S(.|\s)*/), | ||
name: new RegExp(/^[\x00-\x7F]+$/), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of interest, did you try running this against some of the names we receive in RT:
- 邮箱未激活
- 张凯强
- 回复
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No but I did now. It does return the proper error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I add valid input values in the form on the sandbox the registration button is never enabled. There doesn't appear to be any javascript errors, and javascript seems to be working and it correctly shows an error when I include unicode. Do we know if the button will work in the live site but not in a sandbox, @Mehrnaz-Charkhchi ?
Hi @Mehrnaz-Charkhchi I searched for |
@jyothishnt it is used to add a class name to the form element, which is then targeted by javascript for validation. See
|
Aah cool. Thanks I missed that one! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue with the register button remaining greyed out is to do with the sandbox site. We'll check it on staging or test before merging to postreleasefix/111 but it looks good otherwise.
@Mehrnaz-Charkhchi Any update on this? |
Description
Add validation to the name field of registration for to prevent users from using non-ascii characters.
Views affected
https://www.ensembl.org/Multi/Account/Register
http://wp-np2-1e:8788/Multi/Account/Register
Possible complications
Since field type "Name" is added in this process it shouldn't affect other fields.
Merge conflicts
Related JIRA Issues (EBI developers only)
ENSWEB-6907