Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

newbie (again) - visible and invisible

Avatar

Former Community Member
Hi,



it's me again, since I was previously directed where I needed to go through help from this forum I am hoping you guys can do it again.



Here is what I am trying to do.

I have the first user selecting a number of fields (via a checkbox) like first and last name, addy and email and so on, depending on which info they need...

and then the fields that are not needed and the checkboxes are hidden...and the document is sent of to a second user who can then enter the requested info...



is this even possible?



Thanks so much in advance.



Cheers,



Olli
5 Replies

Avatar

Former Community Member
Sure! You would simply need to use data stored in your form to determine the initial visibility of the fields.



For example, you would setup your form to have an initial state where the check boxes for each field are visible and the fields are disabled (because the purpose here is to select the fields that are required to be filled by the next person in the workflow). You would also have an invisible check box somewhere named, say, "FillFields", which is "off" by default. Finally, you would have two buttons: The first would be a regular push button which, when clicked, would first set the value of the "FillFields" check box to "1" and then call the Click event of the second, invisible, button (a submit button set to submit the data) which would then cause the form to be submitted.



Note that you need to use the two-button approach so that you can set the value "FillFields" at the time when the form is submitted. Using the actual submit button's PreSubmit event is too late because the form's data has already been accumulated and stored at that point in time.



Once you have all that in place, you would just need some simple script in the Initialize event of all the check boxes and fields to check their initial values (which, once the form has been submitted by the first user, will now contain data). If a check box's initial value is "1" and "FillFields" is "1", then you enable its pertaining field; if "FillFields" is "1" and the check box's initial value is "0", you hide the field. Also, if the "FillFields" check box's initial value is "1", you hide all the other check boxes.



At this point, the user is left with only the required fields. They can then fill the fields and re-submit the form.



I've attached a sample which illustrates all these concepts to get you started.



Stefan

Adobe Systems

Avatar

Former Community Member
Hi Stefan,



first of all thanks.

secondly. WOW!!! :)



I will definetly work on this during the week and try and implement it...again: Thank you so much.



Cheers,



Olli

Avatar

Former Community Member
Hi Stefan,



am I correct in assuming that I need the Adobe Reader Extensions package to get this to work?

Also could it be that with one of the buttons the script language needs to be set to Java instead of FormCalc?



I am sorry, maybe this is all very obvious, but I am really completely new and am just trying to figure it out...the logic behind your example is fantastic though.



Thanks again so much.



Cheers,



Olli

Avatar

Former Community Member
You're very welcome!



As far as I know, you shouldn't need Reader Extensions for this sample to work. Also, the "Button" button has FormCalc script in its Click event -- that should be just fine.



What kind of problems are you having? If I knew, it might help me figure-out what's going wrong on your end of things.



Stefan

Adobe Systems