/ Id-Extras Forum / Javascript problems with checkbox using FormMaker

  • Author
  • #6171 Reply
    DonD

    I am simply trying to multiply two values together IF A CHECKBOX IS CHECKED with the following script:

    v1 = this.getField(“TF1”).value;
    v2 = this.getField(“TF2”).value;

    if (this.getField(“Check1”).isBoxChecked(0) == true){
    this.getField(“TF3”).value=v1 * v2;
    }
    else{
    this.getField(“TF3”).value=0;
    }

    BUT,
    1. AFTER FORMMAKER IS ENABLED IN ACROBAT
    2. IMMEDIATELY AFTER CHECKBOX IS SELECT BY END USER
    3. THE CHECKBOX NEVER GETS CHECKED – ERROR DISPLAYS INSTEAD
    (The checkbox will work if I did not select EDIT->FORMMAKER IN ACROBAT, SO THE PROBLEM IS WITH FORMMAKER EXCLUSIVELY)

    I obtain a javascript error:

    “The value entered does not match the value of the field [Check1]”

    SCREENSHOT OF ERROR ATTACHED.

    FormMaker must have though that clicking on the checkbox entered a value that FormMaker did not like, even though FormMaker does not allow you to set FORMATS for checkboxes.

    NEED HELP

    Thanks.

    #6319 Reply
    ~~Ariel~~
    Participant

    Hi Don,
    Your script seems to me to be correct, although I haven’t tried it.
    The error, though, sounds like you have applied a specific format to the checkbox itself.
    In InDesign, with FormMaker open, select the checkbox. Does it have formatting applied to it?
    Ariel

    #6320 Reply
    DonD

    FORM MAKER does not allow a CHECKBOX type to be formated.

    So, where do we go from here to get this to work because FORM MAKER seems to place a default format value in that field since it cannot be set or changed for the CHECKBOX type? However, since there is a javascript error, the value that FORM MAKER is assigning by default is causing the javascript error.

    SO, WHERE DO WE GO FROM HERE?

    THIS IS A REALLY SIMPLE TEST, PERHAPS YOU CAN SET UP THE 3 FIELDS AND USE MY SCRIPT TO SEE WHAT FORM MAKER WILL DO ON YOUR SIDE.

    However, as stated earlier, this is a show-stopper if I cannot change TEXT VALUES based on CHECKBOX or RADIOBUTTONS!

    IF THIS CANNOT BE RESOLVED I WILL UNFORTUNATELY NEED A REFUND. BUT I HOPE YOU CAN GET THIS TO WORK.

    Regards,

    #6321 Reply
    ~~Ariel~~
    Participant

    Hi Don,
    Obviously FormMaker can do this.
    You must have done something wrong in your file. There’s no point in my creating a test file on my end, since this is something that works.
    So could you send me your file, or at least the page from you file that is causing the issues, and I will take a look?
    Thanks,
    Ariel

    #6322 Reply
    DonD

    I will send you the file, but if you don’t mind I will email it to you. Thanks for the help. I really want to get this to work and we are on a tight deadline.

    Thanks.

    #6323 Reply
    ~~Ariel~~
    Participant

    Sure, please email it, you have the address.

    #6324 Reply
    ~~Ariel~~
    Participant

    Hi Don,
    Thanks for the file.
    I took a look and was able to reproduce the problem.
    Somehow, the checkbox has some sort of a script attached to it – maybe at one point it was a text frame?
    Anyway, whatever the case, try selecting the checkbox in InDesign. Change it to a “text field” and then back again to a “checkbox”. This will clear out any old scripts that were lingering. Make sure that its name is still “Check1” after you change it back.
    Now export the interactive PDF with FormMaker, open in Acrobat, run FormMaker, and everything should work as expected.
    Let me know if that fixes the issue for you!
    Thanks,
    Ariel

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Reply #6324 in Javascript problems with checkbox using FormMaker
Your information: