Copy link to clipboard
Copied
Creating a form for people to sign up for an item. I have a check box called "Gold", and I have a description of the line item and a price, say $100 on the form. On the line next to the price is a text box that I want populated as 100 when the check mark is checked. Can this be done and how?
There are various ways you can achieve this with a script.
In the example below, I am using a Custom Calculation script, and I placed the script in the text field where the 100 value should appear into when checkbox "Gold" is checked.
var g = this.getField("Gold");
if (g.value !== "Off") {
event.value = g.value;
} else {
event.value = "";
}
Start with these :
And keep coming back to the forums with questions.
You'll get plenty of valuable guidance from the developers in these forums.
Copy link to clipboard
Copied
Yes, but should the text field be editable for the user? Also, what should it show when the check-box is not ticked?
Copy link to clipboard
Copied
It should be blank. It's a sign up sheet. So if they check the box, there's a price associated with that line.
I want it to automatically place the price into the text box:
__ Sign up for dinner. $50. $_______
The __ is a check box. When it's checked I want 50 to appear on the line (there's a text box there)
Copy link to clipboard
Copied
There are various ways you can achieve this with a script.
In the example below, I am using a Custom Calculation script, and I placed the script in the text field where the 100 value should appear into when checkbox "Gold" is checked.
var g = this.getField("Gold");
if (g.value !== "Off") {
event.value = g.value;
} else {
event.value = "";
}
Copy link to clipboard
Copied
Thank you
Copy link to clipboard
Copied
Is there a book of commands or a way to learn these java scripts that someone can recommend???
Copy link to clipboard
Copied
Start with these :
And keep coming back to the forums with questions.
You'll get plenty of valuable guidance from the developers in these forums.
Copy link to clipboard
Copied
Thank you
Copy link to clipboard
Copied
You're welcome.