
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-28-2022 01:43 AM
Sorry guys. Regex ist just not my thing.
Trying to find regex to check if a floating point field value is negative or not ... .
Should allow 0 and positive but no negative ... .
i.e. .-0,23 .. should return false ... . Also non allowed value should return false ...
Easy one for you and fast way to get a correct answer š
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-28-2022 01:48 AM
Hello
you can try on change client script for this on floating point number field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var negative = /^[0-9].*$/;
if(!negative.test(newValue)){
alert('please do not enter negative values');
g_form.setValue('field',oldValue);
}
}
please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-28-2022 01:48 AM
Hello
you can try on change client script for this on floating point number field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var negative = /^[0-9].*$/;
if(!negative.test(newValue)){
alert('please do not enter negative values');
g_form.setValue('field',oldValue);
}
}
please mark my answer correct if it helps you