make validation phone number with regex

hallo my name is malik junior dev from indonesian


i have a problem with create input data phone number with validation regex

first input number only NUMBER like = 0812345678910 (only number no +/-)

and i still confused about run server action, and i need pattern for phone number


thank you if you help me

Hi Malik, 

Can you refer answer from https://www.outsystems.com/forums/discussion/59670/regex-js-for-phone-validation/

Let me know if this is working

or you can refer https://www.w3resource.com/javascript/form/phone-no-validation.php also

Thanks, Aadhavan S

Hi Azure,


you could use the Regex_Replace and Regex_Search under Text extension module. Please check the sample implementation below that returns if PhoneNo is Valid. Additionally

Hope this helps!
Cheers

Hi Malik, 

Try using this java script,

document.getElementById($parameters.WidgetId).addEventListener("keypress", function(e){

    var patternNotOk = eval("/[^0-9]/g");

    var text = this.value.replace(patternNotOk, '');

    if (this.value != text){

        this.value = text;

    }

});

And use this on input widget event (OnKeyPress).


Hi Malik,

By the Regex you should try this pattern for phone no. 

Pattern = "^[0-9]{10}$"

It will not accept these characters (+, - , e, .)


Thanks & Regards

Navneet 


Simply Suggest, assign data type Phone Number

Regards,

Shahaji

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.