Phone number(E16) type is accepting alphabets

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 07:41 AM
Hi,
I have a phone number field which is phone number(E16) type when am giving alphabets it is accepting without throwing any validation error. Can anyone help me on this how should i restrict alpha numeric validation on E16 type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 07:48 AM
Hello @Community Alums ,
You can use regex to restrict alphabets.
Regards,
Rohini Sane

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 07:52 AM
HI,
Tried with this but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 07:59 AM
Hi @Community Alums ,
Please create onchange client script:
function onChange(control, oldValue, newValue, isLoading) {
if(isLoading || newValue == ''){
return;
}
// Allows formats of (999) 999-9999, 999-999-9999, and 9999999999
var pattern = /^[(]?(\d{3})[)]?[-|\s]?(\d{3})[-|\s]?(\d{4})$/;
if(!pattern.test(newValue)){
alert('Phone enter a valid phone number');
g_form.setValue('u_mobile_number', '');
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2024 08:05 AM
tried with this, still error message is not coming and able to save with alphabets