Skip to content

HAI-709: Valider le numéro de téléphone côté serveur de la personne d… #235

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mogoodrich
Copy link
Member

…e contact

(cherry picked from commit 49d3145)

@@ -27,6 +27,10 @@

setUpPhoneNumberRegex('<uimessage code="pihcore.invalid.phoneNumber"/>');

beforeSubmit.push(function() {
return phoneNumberRegex(getValue('contactPhoneNumber.value'));
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions, and how they work, are defined here:

https://wiki.openmrs.org/display/docs/HTML+Form+Entry+JavaScript+Reference

@@ -131,19 +131,21 @@ function setUpPhoneNumberRegex(badPhoneNumberMsg) {

jq(this).change(function (e) {
let phone = e.target.value;
if (phone.match(phoneNumberPattern().pattern1) || phone.match(phoneNumberPattern().pattern2) || phone.match(phoneNumberPattern().pattern3)) {
if (phoneNumberRegex(phone)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pulled this check out into it's own function on that I could use it in the above code as well.

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.

1 participant