I'm looking for the Javascript syntax to get the value from and assign a value to:
- A plain form field like a text field
- A form field read from the database like {Model.field_name}
- A variable available when the Set Models Data in the Read data action is set.
Any lead on one of the above is highly appreciated!
- A plain form field like a text field
- A form field read from the database like {Model.field_name}
- A variable available when the Set Models Data in the Read data action is set.
Any lead on one of the above is highly appreciated!
Where is the javascript getting the value from? It needs to be already rendered on the page for the script to get the value and assign it elsewhere (eg the value is in a div somewhere on the page).
Let's say your page looks like this:
To retrieve it from the div and place it into input field:
Let's say your page looks like this:
<div id="value">1234</div>
<input type="text" name="amount" id="field">
To retrieve it from the div and place it into input field:
let val = document.getElementById("value").innerText;
document.getElementById("field").value = val;
You need to login to be able to post a reply.