Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Trying to validate a check box

New Here ,
Aug 21, 2021 Aug 21, 2021

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?

TOPICS
PDF forms

Views

66

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 21, 2021 Aug 21, 2021

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?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2021 Aug 21, 2021

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)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 21, 2021 Aug 21, 2021

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

}

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2021 Aug 21, 2021

Copy link to clipboard

Copied

Thank you

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2021 Aug 21, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 21, 2021 Aug 21, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

Thank you

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

LATEST

You're welcome.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines