Scribus Forums

Scribus => PDF Generation => Topic started by: ian on April 09, 2018, 10:48:43 PM

Title: Issue creating PDF form with checkboxes
Post by: ian on April 09, 2018, 10:48:43 PM
Hi,  I'm using scribus 1.5.3 to create a custom PDF form with javascript.

According to the tutorial here:

https://wiki.scribus.net/canvas/Your_second_PDF_form_with_Scribus_(and_Javascript)

You should be able to get and set checkbox content by means of this.getField('checkbox_name').value.

The tutorial states that the value when checked is "On", and when unchecked is "Off".

However this is not working for me.  After some testing, I found that when unchecked the value is indeed returned as "Off".  However, when on, the value is set to the name of the checkbox.

Googling turned up this one forum post with the same issue and no responses:

http://forums.scribus.net/index.php/topic,2426.msg11354.html#msg11354

So my questions:

1. Is this a bug, or intended feature?
2. How should I programatically set checkboxes?

Let me know if there are any other details I can provide to help clarify what's going on.

Thanks,
Ian

Title: Re: Issue creating PDF form with checkboxes
Post by: cypher_null on September 01, 2022, 08:03:19 AM
I have found this forum post as I have the exact same problem with checkboxes created in Scribus 1.5.8

Has this issue ever been adressed?

I have tried to set the checkbox value in JS but this did not work

var checkbox = this.getField("Checkbox30");
if(checkbox.checked === false) {
checkbox.checked = true;
checkbox.value = "On";
} else {
checkbox.checked = false;
checkbox.value = "Off";
}