Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Setting "invisible" fields to "visible"

duncana50866232
Level 1
Level 1

Hi All

My intention is to send customers a list of billing documents, but to hide the data on the form until they have entered a password.

I set the presence of the various fields to "invisible" in a docReady event. (Or even statically on the Object palette).

The user then captures the password in a password field and clicks an "OK" button.

In the click event of the button I compare the password to the value it should be and then I loop through all the fields that need to be made visible and I set the presence to "visible". Sounds great, but the fields remain hidden. Any ideas?

data.#pageSet[0].Page1.Button1::click - (JavaScript, client)

var lineCount = data.SBF_Content.Items.resolveNodes("Row2[*]").length;

if (xfa.resolveNode("data.#pageSet.Page1.password").rawValue  == xfa.resolveNode("data.#pageSet.Page1.Table4.Row4.#field").rawValue)

{

  for (var i = 0; i<lineCount; i++)

  {

  data.SBF_Content.Items.resolveNode("Row2[" + i + "]").FKDAT.presence = "visible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").VBELN.presence = "visible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").WAERK.presence = "visible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").NETWR.presence = "visible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").ReprintPDF.presence = "visible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").downloadScan.presence = "visible"; 

} // for i...

}

else

{

  app.alert("Passwords do not match");

    for (var i = 0; i<lineCount; i++)

  {

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").FKDAT.presence = "invisible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").VBELN.presence = "invisible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").WAERK.presence = "invisible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").NETWR.presence = "invisible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").ReprintPDF.presence = "invisible";

data.SBF_Content.Items.resolveNode("Row2[" + i + "]").downloadScan.presence = "invisible"; 

} //for i...

}

1 Reply
duncana50866232
Level 1
Level 1

Further to the above, can anybody suggest a better way to password-protect the form?

The above would only hide the data from a normal user accessing the data via Adobe Reader etc. but anyone could still extract the XML easily enough.