6. Edit Form.js

OnDemand supports dynamic interactive forms using a file named ~/ondemand/dev/bc_my_center_matlab/form.js. This file is free-form; anything that can be done with client-side JavaScript may be done in this file. OSC has used this file to:

  • Limit the user’s CPU/memory selection options to the type of hardware that they are requesting (OSC MATLAB JavaScript)
  • Show or hide a license field based on whether the user is permitted to use the OSC academic license or if they are required to use a different license provider (OSC ANSYS JavaScript)
  • Implement a file picker using the File Explorer’s API, Webpack, and VueJS (bc_js_filepicker)

Warning

Be aware that client side validation provided by JavaScript is not perfect and any critical values should be validated / sanitized server side in script.sh.erb or submit.yml.erb.

Note

This file is not required and may be empty or not exist.