Skip to main content
Inspiring
Apr 1, 2025 10:17 PM UTC
Answered

checkbox não funciona

Boa Noite a todos, acho que agora esta a virar rotina, lol.

Fiz um código e novamente não funciona.

Tenho 3 checkbox

checkbox1 com nome de sim

checkbox2 com o nome de nao

checkbox3 com o nome de aceito

se o checkbox 3 estiver checado o checkbox1 fica ativo

se o checkbox 3 nao estiver checado o checkbox2 fica ativo e limpa o checkbox 1.

O que esta errado?

 

// Script para Adobe Acrobat: Desmarcar um checkbox ao selecionar outro

var checkbox1 = this.getField("aceito");
var checkbox2 = this.getField("sim");
var checkbox3 = this.getField("nao");

if (checkbox1.isBoxChecked(0)) {
    checkbox2.checkThisBox(true, 0);
    checkbox3.checkThisBox(false, 0);
}else{
    checkbox2.checkThisBox(false, 0);
    checkbox3.checkThisBox(true, 0);
}
PDF Automation Station
Community Expert
Apr 2, 2025 12:02 AM UTC

You have the checkThisBox parameters reversed.  nWidget goes first and bCheckIt goes 2nd.  Example checkThisBox(0, true) not checkThisBox(true, 0)

3 replies

PDF Automation Station
Community Expert
Community Expert
Apr 2, 2025 12:02 AM UTC

You have the checkThisBox parameters reversed.  nWidget goes first and bCheckIt goes 2nd.  Example checkThisBox(0, true) not checkThisBox(true, 0)

Translate
try67
Community Expert
Community Expert
Apr 1, 2025 10:36 PM UTC

Where did you place the code? Are there any error messages when it is executed? What exactly happens when it is executed?

Translate
Inspiring
Apr 2, 2025 9:56 PM UTC

Fiz uma ação quando o checkbox perder o foco.

Não dá mensagem de erro, apenas não funciona.

Translate