• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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 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
How to

Views

416

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

correct answers 1 Correct answer

Community Expert , Jul 08, 2020 Jul 08, 2020

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).

 

Votes

Translate

Translate
Community Expert ,
Jul 08, 2020 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).

 

Votes

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
Community Expert ,
Jul 08, 2020 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  ?

Votes

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

Votes

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

Copy link to clipboard

Copied

LATEST

Ok , you're very welcome

Votes

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