terminal42 / contao-conditionalformfields

Display form fields conditionally in Contao Open Source CMS
MIT License
18 stars 11 forks source link

If fields with dash (-) are present in the form, js throws error #63

Closed falkgeist closed 1 year ago

falkgeist commented 2 years ago

Contao: 4.13 Extension version: 3.x

If there are fieldnames with dash, e.g. 'form-field', the conditionalformfields.js throws the error "Missing declaration for const" since the dash is interpreted as subtraction operator on https://github.com/terminal42/contao-conditionalformfields/blob/main/public/conditionalformfields.js#L36 and thus not affecting the form in any way.

Possible solution imho would be to re-introduce the dollar-sign for the variables, since version 2.3.4 ist not throwing that error and still uses the dollar sign.

aschempp commented 1 year ago

This should be "fixed" in cb34e319865c90b1c34de030f9f28de249bd0c46