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

Checkboxes are not be enabled

New Here ,
Aug 22, 2017 Aug 22, 2017

I added some javascript that worked yesterday but now it is not working. When the oh.value is a certain number checkboxes are checked.

var oat = this.getField("OrderAmtTotals");

var oa3 = this.getField("OrderAmt3");

var oa4 = this.getField("OrderAmt4");

var hr = this.getField("HostRetailTotal");

var oh = this.getField("OrderPlusHostRetail");

if ((oa4.value !=null) || (oa3.value !=null && hr.value !=null))

{

if (oh.value < 150.00)

{

event.value = 0;

getField("HalfPrice1").checkThisBox(0,false);

getField("HalfPrice2").checkThisBox(0,false);

getField("HalfPrice3").checkThisBox(0,false);

getField("HalfPrice4").checkThisBox(0,false);

getField("HalfPrice5").checkThisBox(0,false);

}

else if (oh.value > 149.99 && oh.value < 300)

{

event.value = oh.value * .10;

getField("HalfPrice1").checkThisBox(0,true);

getField("HalfPrice2").checkThisBox(0,true);

getField("HalfPrice3").checkThisBox(0,false);

getField("HalfPrice4").checkThisBox(0,false);

getField("HalfPrice5").checkThisBox(0,false);

}

else if (oh.value > 299.99 && oh.value < 600)

{

event.value = oh.value * .15;

getField("HalfPrice1").checkThisBox(0,true);

getField("HalfPrice2").checkThisBox(0,true);

getField("HalfPrice3").checkThisBox(0,true);

getField("HalfPrice4").checkThisBox(0,false);

getField("HalfPrice5").checkThisBox(0,false);

}

else if (oh.value > 599.99 && oh.value < 1000)

{

event.value = oh.value * .20;

getField("HalfPrice1").checkThisBox(0,true);

getField("HalfPrice2").checkThisBox(0,true);

getField("HalfPrice3").checkThisBox(0,true);

getField("HalfPrice4").checkThisBox(0,true);

getField("HalfPrice5").checkThisBox(0,false);

}

else if (oh.value > 999.99)

{

event.value = oh.value * .25;

getField("HalfPrice1").checkThisBox(0,true);

getField("HalfPrice2").checkThisBox(0,true);

getField("HalfPrice3").checkThisBox(0,true);

getField("HalfPrice4").checkThisBox(0,true);

getField("HalfPrice5").checkThisBox(0,true);

}

else event.value = 0;

getField("HalfPrice1").checkThisBox(0,false);

getField("HalfPrice2").checkThisBox(0,false);

getField("HalfPrice3").checkThisBox(0,false);

getField("HalfPrice4").checkThisBox(0,false);

getField("HalfPrice5").checkThisBox(0,false);

}

TOPICS
Acrobat SDK and JavaScript , Windows
289
Translate
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 ,
Aug 22, 2017 Aug 22, 2017

What exactly is the problem?


Also, your if-conditions are weird. Instead of using this:

if (oh.value > 149.99 && oh.value < 300)

Use:

if (oh.value >= 150 && oh.value < 300)

Translate
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, 2017 Aug 22, 2017
LATEST

I did this but no change to the checkboxes...

Translate
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 ,
Aug 22, 2017 Aug 22, 2017

For the last else use:

else {

event.value = 0;

getField("HalfPrice1").checkThisBox(0,false);

getField("HalfPrice2").checkThisBox(0,false);

getField("HalfPrice3").checkThisBox(0,false);

getField("HalfPrice4").checkThisBox(0,false);

getField("HalfPrice5").checkThisBox(0,false);

}

Translate
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