Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

The value of the category field should appear in the short description field.

TanujB
Tera Contributor
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
var categoryValue = gForm.getValue('category');
    gForm.setValue('short_description', categoryValue);
}
I am using this code but this is not workable in client Scripting please help in this  
1 ACCEPTED SOLUTION

J Siva
Kilo Patron

Hi @TanujB 
It's g_form not gForm.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
var categoryValue = g_form.getValue('category');
    g_form.setValue('short_description', categoryValue);
}

Regards,
Siva

View solution in original post

4 REPLIES 4

J Siva
Kilo Patron

Hi @TanujB 
It's g_form not gForm.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
var categoryValue = g_form.getValue('category');
    g_form.setValue('short_description', categoryValue);
}

Regards,
Siva

glideFather
Tera Patron

@TanujB 

 

it looks ok, try to clear the value in short description before you enter it there:

var categoryValue = gForm.getValue('category');
if (categoryValue) {
gForm.clearValue('short_description');
gForm.setValue('short_description', categoryValue);
}

 


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

@TanujB oh and now I noticed..

what is gForm? shall it not be g_form? :)))


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---

Hi @TanujB I provided the same solution at the same time, could you please consider accepting as solution as well, please


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---