Global Form Items: cant use `global_gpu_l40s` but can use `global_gpu_l40`

I have my global variables set and working. We’re adding L40S so I add the lines like before. However, the form breaks when I use global_gpu_l40s.

Here is the working code

  global_gpu:
    widget: select
    label: "GPU type"
    options:
      - [
          'none', 'none',
          data-hide-global-gpu-rtx8000: true,
          data-set-global-gpu-rtx8000: 0,
          data-hide-global-gpu-a100: true,
          data-set-global-gpu-a100: 0,
          data-hide-global-gpu-v100: true,
          data-set-global-gpu-v100: 0,
          data-hide-global-gpu-h200: true,
          data-set-global-gpu-h200: 0,
          data-hide-global-gpu-l40: true, #<----
          data-set-global-gpu-l40: 0      #<----
        ]
      - [
          'any', 'any',
          data-hide-global-gpu-rtx8000: true,
          data-set-global-gpu-rtx8000: 0,
          data-hide-global-gpu-a100: true,
          data-set-global-gpu-a100: 0,
          data-hide-global-gpu-v100: true,
          data-set-global-gpu-v100: 0,
          data-hide-global-gpu-h200: true,
          data-set-global-gpu-h200: 0,
          data-hide-global-gpu-l40: true,
          data-set-global-gpu-l40: 0
        ]
      - [
          'select', 'select',
          data-hide-global-gpu-rtx8000: false,
          data-hide-global-gpu-a100: false,
          data-hide-global-gpu-v100: false,
          data-hide-global-gpu-h200: false,
          data-hide-global-gpu-l40: false
        ]

  global_gpu_rtx8000:
    widget: check_box
    label: "RTX8000"
    checked_value: 1
    unchecked_value: 0
  global_gpu_l40:
    widget: check_box
    label: "L40S"
    checked_value: 1
    unchecked_value: 0
  global_gpu_a100:
    widget: check_box
    label: "A100"
    checked_value: 1
    unchecked_value: 0
  global_gpu_v100:
    widget: check_box
    label: "V100"
    checked_value: 1
    unchecked_value: 0
  global_gpu_h200:
    widget: check_box
    label: "H200"
    checked_value: 1
    unchecked_value: 0

My form:

cluster:
  - hpc

form:
  - global_jupyter_interface
  - global_num_cores
  - global_mem
  - global_gpu
  - global_gpu_rtx8000
  - global_gpu_a100
  - global_gpu_v100
  - global_gpu_h200
  - global_gpu_l40s
  - auto_accounts
  - global_other_slurm
  - global_working_directory
  - bc_num_hours
  - bc_email_on_started
  - modules
  - job_name

attributes:
  modules: "anaconda3/2025.06"
  job_name: "OOD-<%= File.basename(File.dirname(__FILE__)) %>"

When an “s” is added to “l40”, the form breaks the hide/show feature simply showing all checkbox options. The browser gets the following error in console.

jquery.js:3783 jQuery.Deferred exception: Cannot read properties of null (reading 'type') TypeError: Cannot read properties of null (reading 'type')
    at q (https://myhost.com/pun/sys/dashboard/assets/batch_connect_session_…82b855d….js:1:10526)
    at ge (https://myhost.com/pun/sys/dashboard/assets/batch_connect_session_…82b855d….js:1:10319)
    at https://myhost.com/pun/sys/dashboard/assets/batch_connect_session_…182b855….js:1:8766
    at Array.forEach (<anonymous>)
    at HTMLOptionElement.<anonymous> (https://myhost.com/pun/sys/dashboard/assets/batch_connect_session_…182b855….js:1:8487)
    at u.each (https://myhost.com/pun/sys/dashboard/assets/application-da1fc6f….js:1:3435)
    at u.fn.init.each (https://myhost.com/pun/sys/dashboard/assets/application-da1fc6f….js:1:1908)
    at HTMLSelectElement.<anonymous> (https://myhost.com/pun/sys/dashboard/assets/batch_connect_session_…182b855….js:1:8398)
    at u.each (https://myhost.com/pun/sys/dashboard/assets/application-da1fc6f….js:1:3435)
    at u.fn.init.each (https://myhost.com/pun/sys/dashboard/assets/application-da1fc6f….js:1:1908) undefined
jquery.js:3793 Uncaught TypeError: Cannot read properties of null (reading 'type')
    at q (dynamic_forms.js:333:16)
    at ge (dynamic_forms.js:320:3)
    at dynamic_forms.js:146:17
    at Array.forEach (<anonymous>)
    at HTMLOptionElement.<anonymous> (dynamic_forms.js:136:18)
    at HTMLSelectElement.<anonymous> (dynamic_forms.js:129:15)

I’ve tried a few different attempts

  1. global_gpu_l40s: fails
  2. global_gpu_l40sl: fails
  3. global_gpu_ll: works
  4. global_gpu_l4l: fails
  5. global_gpu_a1a: fails

Did I miss instructions on naming convention for naming global variables? Maybe there’s a regex not liking text + number + text?

I don’t think you missed anything. In theory we’d like to support anything, but in practice it’s very hard. The issue is the way HTML data attributes are cast from HTML text to javascript attributes in browsers. I don’t think we’ve found a reliable way to cast these things back and forth yet.