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

BUGFIX - validate form fields before submitting #155

Closed
wants to merge 12 commits into from

Conversation

s-barrah
Copy link
Contributor

@s-barrah s-barrah commented Mar 7, 2019

BUGFIX - validate form fields before submitting

@Heleen-cr
Copy link
Contributor

Heleen-cr commented Mar 7, 2019

I think it's a matter of updating the regex patterns we're using and not allow the string to start with a space? We'll need to update the postcodelookup in storybook. At the same time we can update the postcode field to turn off autocomplete.

@Heleen-cr
Copy link
Contributor

for example for the last name field you can update the json with: "pattern": "^[A-Za-z0-9][A-Za-z0-9 ,.()\/&\\-']+$",

@s-barrah
Copy link
Contributor Author

s-barrah commented Mar 7, 2019

for example for the last name field you can update the json with: "pattern": "^[A-Za-z0-9][A-Za-z0-9 ,.()\/&\\-']+$",
@Heleen-cr
The postcode issue is on donate and not Giftaid. There is no problem with the last name field. What is happening on Giftaid is that some forms are getting submitted with empty address line 1 and postcode fields. I have added a validation to ensure the form doesn't submit unless these fields are not empty.

@s-barrah
Copy link
Contributor Author

s-barrah commented Mar 7, 2019

I think it's a matter of updating the regex patterns we're using and not allow the string to start with a space? We'll need to update the postcodelookup in storybook. At the same time we can update the postcode field to turn off autocomplete.

Okay

@Heleen-cr
Copy link
Contributor

Ok yeah that's one way of doing it.
Though I think we need to look at the source of the issue.
I think the main problem lies in the regex for the address fields in the postcode lookup and we should fix it there as this is also an issue on Donate.

The postcode problem mentioned above is indeed on donate, since donate hasn't been updated to the latest postcode fixes in storybook.

Also are you sure there's no issue with the last name field? ;)

@s-barrah
Copy link
Contributor Author

s-barrah commented Mar 7, 2019

Ok yeah that's one way of doing it.
Though I think we need to look at the source of the issue.
I think the main problem lies in the regex for the address fields in the postcode lookup and we should fix it there as this is also an issue on Donate.

The postcode problem mentioned above is indeed on donate, since donate hasn't been updated to the latest postcode fixes in storybook.

Also are you sure there's no issue with the last name field? ;)

The currently problem is that we have forms submitting with empty values for address1 and postcode fields. I have added a fix to prevent the form from submitting if any of the required fields are empty. Validation SHOULD fail if any of the required fields is empty. I am currently updating storybook autocomplete property for input fields and also a security issue with shelljs

@s-barrah s-barrah closed this Jun 18, 2019
@s-barrah s-barrah deleted the fix_validations branch June 18, 2019 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants