These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Mandatory fields not showing when subform is hidden

shellm
Registered: Sep 27 2009
Posts: 20

Hi

I am using Adobe Livecycle Designer 8.0 and creating a dynamic form I have fields which need to be mandatory that are hidden in a subform so if the form is submitted I don't want these fields to show as mandatory unless the subform has been chosen as an option. Also I don't want the read border to show if the field is already filled in.

Is there a simple code that can do this.

It would also be good if I could make checkboxes mandatory ????

thanks
shellm

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can deactivate the mandatory property for a field by a script.

If the field value is not null (it is filled), the following script will deactivate the nullTest and the field isn't mandatory until the user deletes the value.
Form1.#subform[0].Textfeld1::exit - (JavaScript, client) if (this.rawValue != null){this.mandatory = "disabled";}else{this.mandatory = "error";}

You also can do this, if you hide fields. The script is basically the same.
Form1.#subform[0].#subform[1].Textfeld2::ready:form - (JavaScript, client) if (this.presence == "hidden"){this.mandatory = "disabled";}else{this.mandatory = "error";}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

shellm
Registered: Sep 27 2009
Posts: 20
Hi radzmar

It has taken me a while to get back to this and I have tried this several times however I can't seem to get the field not to show up as mandatory even when it is hidden.

I tried putting in the direct path not just this. and also didn't work.

I tried making the field user required or user optional niether worked

I have used the following script (exit function)on fields that are not hidden with the user required option and it works but doesn't work on the hidden fields either

if (postiontypesub.positionnumber.rawValue != null){
postiontypesub.positionnumber.mandatory = "disabled";
}

what am I doing wrong am I missing a step

shellm
xrum
Registered: Feb 25 2009
Posts: 124
if you set the subform as hidden, the fields inside that subform should nto be visible nor should they be required.

but here is how you set the field to not be required:


TextField1.validate.nullTest="disabled"
TextField1.validate.nullTest="error"
shellm
Registered: Sep 27 2009
Posts: 20
where do I put this code on initialize or on the subform
shellm
Registered: Sep 27 2009
Posts: 20
Hi

I have it so the mandatory field is inactive if the field is hidden however of course there is another problem.

I put code on enter and exit process this means though if the user opens the subform but doesn't select that field in anyway it doesn't show as mandatory so how do I get the field to show as mandatory if the subform has been opened but the the text box hasn't been entered.

thanks shellm