@PankajToshiwal
We have further investigated the scenario and found that it is not a Bug. Your document Pdf_With_Validation contains JavaScript code which manages field validation, field visibility, etc. Please find the full JavaScript code in attached 48020.js.48020.zip (40.7 KB)
A problematic checkbox field has name chk1a and its dependent checkboxes are chl1a1, chk1a2, chk1a3. The issue is in javascript code placed in CS90_Custom section. Function validchk() contains the following code:
function validchk(ball) {
//function handleme2(hidefield,startfield,hideifvalue,emptyval,req) {
//function handleme(hidefield,startfield,hideifnotvalue,emptyval,req) {
if (this.pageNum == 1 || ball) {
var q = 0;
if (ball || trigger.name == "chkP_1") {
//participant
handleme2("TailleP_1", "chkP_1", "Off", "", true);
handleme2("TailleUP_1", "chkP_1", "Off", "Off", true);
handleme2("PoidsP_1", "chkP_1", "Off", "", true);
handleme2("PoidsUP_1", "chkP_1", "Off", "Off", true);
handleme2("SexeP_1", "chkP_1", "Off", "Off", true);
......................
if (this.pageNum == 0 || ball) {
this.getField("ParticipantNom_1").value = trim(this.getField("ParticipantNom_0").valueAsString + " " + this.getField("ParticipantPrenom_0").valueAsString);
this.getField("Police_1").value = this.getField("Police_0").value;
this.getField("Certificat_1").value = this.getField("Certificat_0").value;
if (ball || trigger.name == "chk1a") {
handleme2("chk1a1", "chk1a", "Off", "Off", false);
handleme2("chk1a2", "chk1a", "Off", "Off", false);
handleme2("chk1a3", "chk1a", "Off", "Off", false);
}
.......
Please note that block for field “chk1a” (if (ball || trigger.name == “chk1a”)…) if placed inside block " if (this.pageNum == 0 || ball) {"
This, this condition will work ONLY when this field is on the first page (its number is 0 in JavaScript code since internal page indexes are zero-based). After concatenation, this.pageNum = 1 for this field which causes incorrect work of this function (and other validation which is dependent of page).
In order to demonstrate this, we modified JavaScript code of the document by replacing condition : “if (this.pageNum == 1 || ball)” instead of “if (this.pageNum == 0 || ball)”.
Please check the attached document PDF-with-validation-modified.pdf. We also added app.alert
which shows this.pageNum
value. You can see that checkbox does not work properly in the document but it will work if you concatenate this document with another one, placing the validation document in second place.
Thus, in order to fix the issue, JavaScript code in your document should be fixed in order to make it independent of the page number.
Pdf-with-validation-modified.pdf (634.5 KB)