Java script function in Form script not working after a request is submitted

book

Article ID: 8093

calendar_today

Updated On:

Products

CA Service Catalog CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

After submitting the request in service catalog, the java script functions of user form script which has show/hide functions or enable/disable functions stopped working.

For example, consider following scenario:

When we Create a request

     a. Select any radio button from radio group in the user request form.
     b. Based on that certain fields are visible which were by default hidden in the form.
     c. Select values in those fields.
     d. After submitting the request, those fields are missing.

Cause

JavaScript functions in user form script are working as designed because, Catalog will store the values of each form field only but not the state of each field.

Environment

Service Catalog 12.9Service Catalog 14.1Service Catalog 17.0

Resolution

Although it seems like a bug as the fields which we hide/show or enable/disable should remain in that state even after submission of request but Catalog will store the values of each form field only but not the state of each field. After submitting the request, the trigger to evoke java script functions should happen again. It should be controlled manually by the form script.

1. User need to write a script in form onLoad event to explain what should happen when radio button value is selected.

2. All enable/disable, show/hide (done through user script) should be handled appropriately in form onLoad.

3. Once you trigger the java script function to enable/disable, show/hide for form fields again from onLoad function which is there on right side panel, the form will not have missing fields after submission. When the request is displayed after submission, the onLoad function would be triggered each time and javascript functions from user form script would handle all enable/disable, show/hide field functions.

 

<Please see attached file for image>

style="" src="/servlet/servlet.FileDownload?file=0150c000004AK8gAAG" alt="onLoad.jpg" width="1360" height="828">

Attachments

1558714526196000008093_sktwi1f5rjvs16th4.jpeg get_app