Skip to main content
Inspiring
April 1, 2025
Answered

checkbox não funciona

  • April 1, 2025
  • 2 replies
  • 277 views

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);
}
Correct answer PDF Automation Station

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

2 replies

PDF Automation Station
Community Expert
Community Expert
April 2, 2025

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

try67
Community Expert
Community Expert
April 1, 2025

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

Inspiring
April 2, 2025

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

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