onChange Client Script not working on MultiRow Variable Set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 05:25 AM
Hi,
I have written the onChange Client Script for a variable on MRVS. It's not triggering any alert or message. Kindly help.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var req_type = g_form.getValue('request_type');
alert(req_type);
if(req_type == 'Alias (CNAME)'){
g_form.showFieldMsg('request_type', 'Specify the alias domain name', 'info');
}
else if(req_type == 'Host (A or AAAA)'){
g_form.showFieldMsg('request_type', 'Specify the IPV4 or IPv6', 'info');
}
else if(req_type == 'Mail Exchanger (MX)'){
g_form.showFieldMsg('request_type', 'Provide Mail Server Priority and the Mail Server name', 'info');
}
else if(req_type == 'Route Location (SRV)'){
g_form.showFieldMsg('request_type', 'Provide Service, protocol, Priority, Weight, Port Number and Host Offering the service', 'info');
}
else if(req_type == 'Pointer (PTR)'){
g_form.showFieldMsg('request_type', 'Provide the IP address', 'info');
}
else if(req_type == 'Domain Delegation (NS)'){
g_form.showFieldMsg('request_type', 'Provide the list of Name server to delegate', 'info');
}
else if(req_type == 'noinfo'){
g_form.showFieldMsg('request_type', 'Provide the details in the description or add an attachment with the details', 'info');
}
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 06:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 05:39 AM
Hi @Community Alums
Is "Record Type" variable name is request_type ? Or they are different?
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 06:04 AM
Hi @AnveshKumar M ,
You are right. Thank you. I updated it. Still it is not showing anything.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var rec_type = g_form.getValue(record_type);
if(rec_type == 'Alias (CNAME)'){
alert(rec_type);
//g_form.showFieldMsg('record_type', 'Specify the alias domain name', 'info');
}
else if(rec_type == 'Host (A or AAAA)'){
alert(rec_type);
// g_form.showFieldMsg('record_type', 'Specify the IPV4 or IPv6', 'info');
}
else if(rec_type == 'Mail Exchanger (MX)'){
alert(rec_type);
//g_form.showFieldMsg('record_type', 'Provide Mail Server Priority and the Mail Server name', 'info');
}
else if(rec_type == 'Route Location (SRV)'){
alert(rec_type);
// g_form.showFieldMsg('record_type', 'Provide Service, protocol, Priority, Weight, Port Number and Host Offering the service', 'info');
}
else if(rec_type == 'Pointer (PTR)'){
alert(rec_type);
//g_form.showFieldMsg('record_type', 'Provide the IP address', 'info');
}
else if(rec_type == 'Domain Delegation (NS)'){
alert(rec_type);
//g_form.showFieldMsg('record_type', 'Provide the list of Name server to delegate', 'info');
}
else if(rec_type == 'noinfo'){
alert(rec_type);
// g_form.showFieldMsg('record_type', 'Provide the details in the description or add an attachment with the details', 'info');
}
}
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 06:27 AM
@Community Alums
You have to use record_type in quotes.
g_form.getValue('record_type');
Thanks
Deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2024 06:29 AM
Hi @Deepak Negi @AnveshKumar M,
I have no idea what changed, it started to work all of a sudden. Thank you both for the support.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var rec_type = g_form.getValue('record_type');
if (rec_type == 'Alias (CNAME)') {
g_form.showFieldMsg('record_type', 'Specify the alias domain name', 'info');
} else if (rec_type == 'Host (A or AAAA)') {
g_form.showFieldMsg('record_type', 'Specify the IPV4 or IPv6', 'info');
} else if (rec_type == 'Mail Exchanger (MX)') {
g_form.showFieldMsg('record_type', 'Provide Mail Server Priority and the Mail Server name', 'info');
} else if (rec_type == 'Route Location (SRV)') {
g_form.showFieldMsg('record_type', 'Provide Service, protocol, Priority, Weight, Port Number and Host Offering the service', 'info');
} else if (rec_type == 'Pointer (PTR)') {
g_form.showFieldMsg('record_type', 'Provide the IP address', 'info');
} else if (rec_type == 'Domain Delegation (NS)') {
g_form.showFieldMsg('record_type', 'Provide the list of Name server to delegate', 'info');
} else if (rec_type == 'noinfo') {
g_form.showFieldMsg('record_type', 'Provide the details in the description or add an attachment with the details', 'info');
}
}
Regards
Suman P.
