Copy link to clipboard
Copied
I've searched the forum community and while this question may have been answered previously, I cannot seem to locate quite the same condition.
We have an Order Form that has a Text box ( PROMO_CODE ) where someone can fill in a Specific Word that is supposed to qualify them for a Discount. I have a separate text box that automatically calculates the Discount regardless of whether the Text is entered called ( Discount_Subtotal ).
( Discount_Subtotal ) is calculating correctly when that specific product is ordered.
What I am trying to do is test for the ( PROMO_CODE ) such that if that specific word is entered, it will pull over the ( Discount_Subtotal ) and be calculated in the Final Total along with Shipping costs if any.
Here is what I have currently for the Javascript:
var nPROMO_CODE = this.getField("PROMO_CODE").value;
if( nPROMO_CODE = "SPECIFIC_WORD") event.value = Discount_Subtotal;
else event.value = 0;
This isn't working however as when I enter the SPECIFIC_WORD, the Discount is not carried over.
Would someone be able to assist with the correct syntax?
Incidentally this is using Adobe Acrobat XI Pro.
Thanks in advance and Kindest Regards,
Don
Change this line:
if( nPROMO_CODE = "SPECIFIC_WORD") event.value = Discount_Subtotal;
To:
if (nPROMO_CODE == "SPECIFIC_WORD") event.value = this.getField("Discount_Subtotal").value;
Copy link to clipboard
Copied
Change this line:
if( nPROMO_CODE = "SPECIFIC_WORD") event.value = Discount_Subtotal;
To:
if (nPROMO_CODE == "SPECIFIC_WORD") event.value = this.getField("Discount_Subtotal").value;
Copy link to clipboard
Copied
Thank you.
Just tried it and worked just like we wanted it to.
Kindest Regards,
Don
Find more inspiration, events, and resources on the new Adobe Community
Explore Now