Getting a var into Javascript

Pass a CF variable into JavaScript.

Overview

The curly bracket syntax for embedding variables directly in JavaScript is not yet functional.
Set the variable's value to a hidden form field first, then reference that field's value from your JavaScript code.

Answered
ChronoForms v8
ja jamesconwayexp386 31 Jul, 2025

How do I get a Var: into javascript?

I have tried curly brackets and php?

Getting a var into Javascript image 1

Max_admin Max_admin 01 Aug, 2025
Answer

That should work in the next update, for now you may set the value of a hidden field to the var, and use:

document.querySelector("[name='hidden-field-name']").value
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply