- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 01:06 PM
Hi,
I have wrote the onChange client script that I want an alert to pop up when the data protection type is US, and apparently it doesn'y work. Can some one advise me on this?
Thanks
function onChange(control, oldValue, newValue, isLoading, isTemplate){
if (isLoading || newValue === '') {
return;
}
var dtype = g_form.getValue('u_data_protection_type') ;
if (dtype == 'u_dp_us' ) {
alert('Test');}}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 01:27 PM
You can use the below script:
function onChange(control, oldValue, newValue, isLoading, isTemplate){
if (isLoading || newValue === '') {
return;
}
var dtype = g_form.getValue('u_data_protection_type') ;
if (dtype == 'sys_id' ) { // Replace sys_id with the sys id that you got.
alert('Test');}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 01:12 PM
Can you try
if (dtype.toString() == 'u_dp_us' )
Also check conditions on client script. It should be "onChange" field "u_data_protection_type"
Thanks.
PS: Hit like, Helpful, Correct, if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 01:13 PM
first cheeck what the variable is having value by updating the script like below:
function onChange(control, oldValue, newValue, isLoading, isTemplate){
if (isLoading || newValue === '') {
return;
}
var dtype = g_form.getValue('u_data_protection_type') ;
alert(dtype );
if (dtype == 'u_dp_us' ) {
alert('Test');}
}
Thanks,
Arindam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 01:24 PM
Hi Arindam,
Thanks for your reply, this worked, but instead of me message it is showing a sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 01:27 PM
You can use the below script:
function onChange(control, oldValue, newValue, isLoading, isTemplate){
if (isLoading || newValue === '') {
return;
}
var dtype = g_form.getValue('u_data_protection_type') ;
if (dtype == 'sys_id' ) { // Replace sys_id with the sys id that you got.
alert('Test');}
}