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

Document ID : KB000008093
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

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.

Environment:
Service Catalog 12.9Service Catalog 14.1Service Catalog 17.0
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.

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.

 onLoad.jpg