Highlighted

I can't get the values to disappear and be blank if the box is unchecked, anyone know what is wrong

New Here ,
Jul 07, 2020

Copy link to clipboard

Copied

if (this.getField("check_co3").value=="yes") event.value=(7000+(this.getField("cop_3").value-50000)*15); else event.value = ""

Topics

Bug, Community Information, How to

Views

52

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

I can't get the values to disappear and be blank if the box is unchecked, anyone know what is wrong

New Here ,
Jul 07, 2020

Copy link to clipboard

Copied

if (this.getField("check_co3").value=="yes") event.value=(7000+(this.getField("cop_3").value-50000)*15); else event.value = ""

Topics

Bug, Community Information, How to

Views

53

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
Adobe Community Professional ,
Jul 08, 2020

Copy link to clipboard

Copied

This has been answered before in a old thread.

 

 

Watch how you're spelling "yes" instead of "Yes". 

 

But, in any case try it like this:

 

//using not equal to "Off" instead of "Yes" because the default state of the chechbox should be unchecked 

if (this.getField("check_co3").value !=="Off") {
event.value = (7000+(this.getField("cop_3").value-50000)*15);
}
else event.value = "";

 

 

I haven't tested this on my end but give it a try ( I may be wrong).

 

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
Reply
Loading...
Adobe Community Professional ,
Jul 08, 2020

Copy link to clipboard

Copied

Also, where are you trying to run this script from?

 

Is it a mouse-up javascript action in the checkbox object or are you using this code as a custom calcution script in the text field where you want to display the  total  ?

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
Reply
Loading...
New Here ,
Jul 08, 2020

Copy link to clipboard

Copied

Its okay the solution came to me as soon as my phone stopped ringing constantly lol you know how it goes... busy work distracts the mind,,, 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
Reply
Loading...
ls_rbls LATEST
Adobe Community Professional ,
Jul 08, 2020

Copy link to clipboard

Copied

Ok , you're very 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
Reply
Loading...
Resources
One Stop Solution for Acrobat
Edit a PDF