- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2017 10:05 AM
How to check regular expression for a text field. For example: In the text field user should needs to enter only 552 to 574 numbers .they should enter only numeric number within the specified numbers.how can we check this using regular expression or any other way.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 03:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2017 11:16 AM
If you want to check on form, then use below.
Create onSubmit client script.
In script, perform checks on input values.
var input = g_form.getValue(""); --> column name
if( typeof input == number && parseInt(input) < = 574 && parseInt(input) > = 552)
Community Code Snippets: Some Observations on parseInt, and parseFloat
And if you want to include in HTML, You can find regex online. There are many ways to achieve it.
ex. string.match(/^[0-9]+$/) != null; ,
var isNumber = /^\d+$/.test(theValue);
Thanks.
PS: Hit like, Helpful, Correct and Endorse, if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 01:08 AM
Hi Nisha,
Thanks for the input. I tried but no luck.
I am trying
var regexp= new RegExp("^azwv[5175-5199]{4}$");
if(!regexp.test(val) ){
g_form.showErrorBox("servername","Enter server id as following format within the available numbers (5175-5199) (e.g.,azwv5175 ) ");
it is working partially. It is taking only 5175 and 5199 but it needs to take from 5175 to 5199. Something is missing in the code. can anyone help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 03:45 AM
Hi,
Try this regex: ^azwv51((75|76|77|78|79)|[8-9][0-9])$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 07:03 AM
Hi Vitaly,
Sorry, but this regex looks really interesting. Can you please explain how this works?