How to show popup on catalog item based on the user selection

divyal09
Tera Contributor

If user selects multiple account in a field on catalog form on portal page then a popup should be visible for some of the accounts selected by the user, the account names are random and out of 12 account names 4 account names should show the popup like please contact service desk for assistance

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage
Tera Sage

Hi @divyal09 ,

 

You can try something like this with onChange client script for that field. Kindly use proper backend names of the variable & account names.

 

 

 

var accountName = g_form.getValue('user_account_name')// please update the correct name of the variable where accounts are added.

if(accountName.indexOf('Account1') > -1 || accountName.indexOf('Account2') > -1 || accountName.indexOf('Account3') > -1 || accountName.indexOf('Account4') > -1){

alert('Please Contact certain team');\\ please rewrite ur expected msg inside the alert

}

 

 

  

Thanks,

Danish

 

View solution in original post

6 REPLIES 6

Danish Bhairag2
Tera Sage
Tera Sage

Hi @divyal09 ,

 

You can try something like this with onChange client script for that field. Kindly use proper backend names of the variable & account names.

 

 

 

var accountName = g_form.getValue('user_account_name')// please update the correct name of the variable where accounts are added.

if(accountName.indexOf('Account1') > -1 || accountName.indexOf('Account2') > -1 || accountName.indexOf('Account3') > -1 || accountName.indexOf('Account4') > -1){

alert('Please Contact certain team');\\ please rewrite ur expected msg inside the alert

}

 

 

  

Thanks,

Danish

 

Thank You for your help but the issue is like for all the account selected after the popup is shown its showing popup for all the accounts name not just for four accounts