- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 04:50 AM
I have a Variable with 3 choices:
1. choice A
2. choice B
3. choice C
and I have 3 other variables source, ip, port. Now, clear the values of those variables
whenever the choice variable value changes.
Anyone help me to do this..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 08:59 PM - edited 06-27-2024 09:01 PM
Hi @Hema koneti ,
You can achieve this by writing a onchange Client script, Here is the script which helps to solve your problem:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '' ) {
return;
}
// this Onchange() client script should be written on the variable having 3 choices.
g_form.clearValue('variable_name'); // source
g_form.clearValue('variable_name'); // IP
g_form.clearValue('variable_name'); // port
}
To assist others (or for me to help you more effectively), please click "Accept as Solution" and/or give Kudos.
Thanks, Aditya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 05:20 AM
Whenever you are selecting the choice variable just write a on change script below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 05:21 AM - edited 06-27-2024 05:24 AM
Hi @Hema koneti,
This can easily be achieved with an onChange catalog Client Script.
Create an onChange Script, make sure you select the type onChange, and make sure you associate it with the Choice field which can change:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '' ) {
return;
}
if (newValue != oldValue) {
g_form.clearValue('your_source_field_name');
g_form.clearValue('your_ip_field_name');
g_form.clearValue('your_port_field_name');
}
}
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2024 08:59 PM - edited 06-27-2024 09:01 PM
Hi @Hema koneti ,
You can achieve this by writing a onchange Client script, Here is the script which helps to solve your problem:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '' ) {
return;
}
// this Onchange() client script should be written on the variable having 3 choices.
g_form.clearValue('variable_name'); // source
g_form.clearValue('variable_name'); // IP
g_form.clearValue('variable_name'); // port
}
To assist others (or for me to help you more effectively), please click "Accept as Solution" and/or give Kudos.
Thanks, Aditya