Input mask from phone field - New UI

Posted by IramK on 20-Oct-2015 09:12

Hello,

Is there a way we can make the input mask less strict for the Phone field? I noticed that the input mask is quite strict in the latest version (4.0.2) and the number needs to be exact or more than what the mask is specified to be. Could you possibly provide me a solution for this please?

Cheers.

Iram

Posted by Mohammed Siraj on 03-Nov-2015 06:02

We have decided to relax validation on PhoneInput field on both client-side & server-side, so that end-users do not see a change in behavior w.r.t earlier releases.

As done earlier, INPUT MASK defined on a PhoneInput field will just be used for formatting & it will not be required that any field input COMPLETE the input mask.

The fix will be rolled out as 4.0.3.1 service release on Nov. 7, 2015,

All Replies

Posted by Mohammed Siraj on 20-Oct-2015 10:44

Hi Iram,

Can you please elaborate a bit more on this & share an example. Are you stating that validation w.r.t input mask defined against 'Phone' field are incorrect?

Posted by IramK on 20-Oct-2015 11:13

Hello Mohammed,

The validation is correct but in the earlier version of RB i.e. 3.2.0.0, there was an input mask but it would just mask the numbers and not validate it. For Eg:

Input Mask: ### ### ### ###  => 123456789 => would give 123 456 789 and not error in version 3.2.0.0

Where as in version 4.0.2., it would do the masking properly i.e. 123 456 789 and also throw an error stating that its not valid which may not always be the case for international contacts.

Posted by Srinivas Panyala on 21-Oct-2015 02:02

Hi Iram,

You can disable client-side validation using the below javascript, but server side validation will be executed. It will throw the same error. Server side validation is  not modified in 4.0.2. It is same as in 3.2.

<script>

(function () {

 try {

   //execute only for new ui...

   if (!rbf_isNewUI()) {

     return;

   }

rbf_getFieldContext('mobilePhone').getNode().removeAttr('pattern');

 }

 catch (err) {

   if (console) {

     console.log(err);

   }

 }

}) ();

</script>

Thanks

Srinivas

Posted by IramK on 21-Oct-2015 03:35

I've tried the above and it doesn't error on client-side but does error on server-side. However in 3.2.0.0, if I type more or less digits than required, it accepts and allows the record to be saved whereas in 4.0.2. it throws an error. Could you please give me a solution that would avoid the error to pop-up and allow the record to be saved regardless of the number of digits I type in?

  => 3.2.0.0

    => 4.0.2.0

Cheers.

Posted by Mohammed Siraj on 23-Oct-2015 07:26

Hi Iram,

What you are seeing now in Rollbase 4.0.2 is the correct behavior. In input mask, every '#' corresponds to a digit & by design we allow only those inputs which complete the mask.

Will wait for someone to comment on earlier behavior.

However, confirm that presently 'Phone Number' validations are enforced correctly on client-side & server-side. Even if we circumvent around client-side validation, server validation will correctly reject incorrect values.

Posted by IramK on 23-Oct-2015 08:25

So as a general scenario, how are we supposed to be catering for international numbers? The digits vary in that case.

Posted by HosnyA on 02-Nov-2015 09:49

Hi Siraj,

As Iram explained above we have an Object called Account which stores Account details of companies from across the world. As you may know phone number formats are different each country. How would you suggest us use the phone number field in this scenario?

Furthermore, we are also unable to store a proper contact number of our customers in the system console app in the master zone as the contact number field only accepts US number formats.

If you think that the current behaviour is the correct behaviour, you need to have a review of the standard/norm.

Appreciate a quick response.

cheers,

Hosny

Posted by murali on 02-Nov-2015 13:12

Hosny, Let us get back to you on this. This is a loss in userland fucntionality. We may be able to fix this in short order. Shall update you tomorrow on possible fix date.

Posted by Mohammed Siraj on 03-Nov-2015 06:02

We have decided to relax validation on PhoneInput field on both client-side & server-side, so that end-users do not see a change in behavior w.r.t earlier releases.

As done earlier, INPUT MASK defined on a PhoneInput field will just be used for formatting & it will not be required that any field input COMPLETE the input mask.

The fix will be rolled out as 4.0.3.1 service release on Nov. 7, 2015,

Posted by HosnyA on 03-Nov-2015 15:15

Great, that's comforting to hear.

Cheers, Hosny

This thread is closed