CA Service Management

  • 1.  How to control form fields in multiple forms from one script

    Posted Jul 20, 2014 06:36 AM

    Hi all, we use Service Catalog 12.8.  We need to control content of text field in multiple forms via script. For example when user write some text to text field1 in form1 we need to copy value of field1 to form2 to field1.

    I tried to use javascript function in script created directly in form1:

    OnChange:    ca_fd.js.x()   

    {

       x: function() {

    var m = ca_fdGetTextFieldValue('form1', 'field1');

    ca_fdSetTextFieldValue('form1', 'field2', m); // works

    ca_fdSetTextFieldValue('form2', 'field1', m); // doen't work

    }

    }

     

    and I also tried to call function in custom_form_lib.js

    OnChange:x(ca_fdGetTextFieldValue('form1', 'field1')) 

     

    function x(param1) {

    ca_fdSetTextFieldValue('form1','field2',param1); // works

    ca_fdSetTextFieldValue('form2','field1',param1); // doen't work

    }

    but without success in the both cases . It works only inside the form from which is the script called.  I'm sure that this works in Service Catalog 12.5 in case that the both forms form1 and form2 were inside the same Service Option Group.

    Did I make some mistake or this functionality was removed from newer versions of Service Catalog?

    Regards,

    Mila



  • 2.  Re: How to control form fields in multiple forms from one script

    Posted Jul 25, 2014 01:54 AM

    Hi,

     

    Anyone with suggestions for milan.ziga?

     

    Thanks, Kyle_R.



  • 3.  Re: How to control form fields in multiple forms from one script

    Posted Jul 25, 2014 11:14 PM

    Hi,

    it seems this cannot be done. I've finally found information about this in Service Catalog documentation. It says that forms must be in same service option.

    Milan



  • 4.  Re: How to control form fields in multiple forms from one script

    Posted Jul 28, 2014 02:48 PM

    New information. This can be done by calling JavaScript via onLoad action. When the form is already loaded there is no way how to control other forms that are outside of the service option.

    Regards Milan



  • 5.  Re: How to control form fields in multiple forms from one script

    Posted Jul 30, 2014 03:38 AM

    Thanks Milan,

     

     

    Appreciate you taking the effort to provide the extra information.

     

    You can mark your own answer as "Correct Answer" if you wish. 

     

    Thanks, Kyle_R.