UI Policy Case Insensitive Match
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2016 09:34 PM
Hello,
I have a UI policy that I want fired when a field called "colour" is equal to the value "White". However I want this match to be case insensitive. So the field could be "white", "White" or "WHite" and so on. I'm just wondering how I would do this?
I tried using a regex expression match and used the expression: [Wh][Ii][Tt][Ee]
But this did not work.
Regards,
Rhyno
Edit:
Originally I implemented this with client script. I was hoping to achieve this without any client scripts and just use UI Policies if this is possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2016 10:10 PM
Hi,
Use onChange client script.
var s = g_form.getValue('color');
if(s.toLowerCase() == 'white')
{
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2016 01:53 PM
Hey Vinobalu,
Thanks for the response. I have written the same script before but I was hoping to do this without client script if possible?
Is is possible to achieve this with UI policies alone?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2016 07:53 AM
Hi,
You can try using the following code :
var r = new RegExp("white", "i");
var result = r.test('WhiTe');
Please Refer the Follow link for the more Info :
RegExp.prototype.ignoreCase - JavaScript | MDN
Thanks,
Gowri Sankar.