Skip navigation
margosacn
Currently Being Moderated

tick checkbox automatically

Aug 3, 2012 11:45 AM

Tags: #checkbox

I want the checkbox to be ticked automatically when I input something in the text field. If I delete the content of the text field, the checkbox is unticked.

 

I wrote the script as below. But it doesn't work. Could you help me out? Thanks.

 

if(text1.value==""){

checkbox1.rawValue = false;

}

else {

checkbox1.rawValue = true;

}

 
Replies
  • Currently Being Moderated
    Aug 3, 2012 12:25 PM   in reply to margosacn

    Put this in the 'On Blur' action for the field:

     

    if(event.value==""){

         this.getField('checkbox1').value = 'Off';

    } else {

         this.getField('checkbox1').value = 'Yes';

    }

     

    Replace 'checkbox1' with the name of your checkbox, and replace 'Yes' with the checkbox's Export value.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 1:33 PM   in reply to margosacn

    mouse up - runs when the mouse button is released over the field (I'll have to check, but I believe this only runs if the mouse was originally pressed while over the field, and not when pressed elsewhere and moved over the field to release)

    mouse down - runs when the mouse button is pressed over the field

    mouse enter - runs when the mouse is moved over the field

    mouse exit - runs when the mouse is moved off of the field

    on focus - runs when the field becomes active

    on blur - runs when the user exits the field

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 2:11 PM   in reply to margosacn

    You are trying to use LiveCycle's FormCalc script in an Acrobat form that use Acrobat JavaScript.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points