How to prevent certain entries of a text field in Service Catalog
search cancel

How to prevent certain entries of a text field in Service Catalog

book

Article ID: 273802

calendar_today

Updated On:

Products

CA Service Catalog

Issue/Introduction

This tech doc provides a simple js script solution.

Environment

Release : 17.3

Resolution

myfield_onChange : function()   {     
var the-val = ca_fdGetTextFieldValue(formId,"myfield");     
var NotAllowed = ["string1","string2","string3"]     
if(NotAllowed.indexOf(the-val) != -1)     
if (NotAllowed.indexOf(the-val)+1) {       
ca_fdSetTextFieldValue(formId, "myfield","")         
alert(the-val + " is not allowed, please choose enter again.");   
  }  
 },

***note: the field name is myfield***