Input mask from phone field - New UI - Forum - Rollbase - Progress Community

Input mask from phone field - New UI

 Forum

Input mask from phone field - New UI

This question is answered

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

Verified Answer
  • 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,

    Regards,
    Siraj.
All Replies
  • 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?

    Regards,
    Siraj.
  • 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.

  • 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

  • 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.

  • 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.

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

  • 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

  • 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.

  • 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,

    Regards,
    Siraj.
  • Great, that's comforting to hear.

    Cheers, Hosny