Catalog client Script for field visibility
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 06:58 AM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
// return;
}
var tstate=g_form.getValue(state);
if (tstate == '-5'){
g_form.setVisible('u_priority_reason', true);
}
}
why isnt the above working?
- i have made u_priority_reason hidden onload
- i want To make it visible when the dropdown value of state is -5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 07:16 AM
Hi,
Please use the below code.
var tstate=g_form.getValue('state');
if (tstate == -5){
g_form.setVisible('u_priority_reason', true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 11:54 PM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
// return;
}
var tstate=g_form.getValue('state');
if (tstate == -5){
g_form.setVisible('u_priority_reason', true);
}
}
this is not working too !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 11:59 PM
Have you checked what value you are getting in tstate ?
var tstate=g_form.getValue('state');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017 12:08 AM
Hi,
I did this to hide the 'cost' field if the price frequency selected from dropdown is 'monthly' and it is working fine for me.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var tstate=g_form.getValue('recurring_frequency');
alert('tstae>>>'+tstate);
//Type appropriate comment here, and begin script below
if(tstate=='monthly')
{
g_form.setVisible('cost',false);
}