Skip to main content
Participating Frequently
August 21, 2021
Answered

Trying to validate a check box

  • August 21, 2021
  • 3 replies
  • 1643 views

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?

This topic has been closed for replies.
Correct answer ls_rbls

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.

3 replies

RoyRSPAuthor
Participating Frequently
August 22, 2021

Is there a book of commands or a way to learn these java scripts that someone can recommend???

ls_rbls
Community Expert
ls_rblsCommunity ExpertCorrect answer
Community Expert
August 22, 2021

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.

RoyRSPAuthor
Participating Frequently
August 22, 2021

Thank you

ls_rbls
Community Expert
Community Expert
August 21, 2021

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 = "";

}

 

RoyRSPAuthor
Participating Frequently
August 22, 2021

Thank you

try67
Community Expert
Community Expert
August 21, 2021

Yes, but should the text field be editable for the user? Also, what should it show when the check-box is not ticked?

RoyRSPAuthor
Participating Frequently
August 22, 2021

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)