Form example with hidden fields based upon selection

1,152 views
Skip to first unread message

Worst, Debbie

unread,
Feb 24, 2010, 7:33:47 AM2/24/10
to live...@googlegroups.com
Good morning!
 
Does anyone have an example of how to set up a livecycle form where when you select a specific value from a dropdown, additional fields are exposed?
 
I'm developing a form where you choose a value from a dropdown.  Upon the selection, a table with specific fields pertaining to your selection from the dropdown appear.  The problem I'm having is that there is white space where the table is when it is "hidden".
 
Any help would be greatly appreciated...
 

********************************************************************** The content of this e-mail message and any attachments are confidential and may be legally privileged, intended solely for the addressee. If you are not the intended recipient, be advised that any use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you receive this message in error, please notify the sender immediately by reply email and destroy the message and its attachments. **********************************************************************

GL

unread,
Feb 24, 2010, 11:57:02 AM2/24/10
to Adobe LiveCycle Developers
Do you have the table grouped as a subform? And, have the subform
"hidden-exclude from layout'?

I am no expert, but have done some hiding.

Worst, Debbie

unread,
Feb 24, 2010, 12:09:34 PM2/24/10
to live...@googlegroups.com
Yes and it hides dependent on what I select from the dropdown but there is "white space" where the subform used to be when you select an option that is in subform #2 or 3. What I want to do is you select 1 from the dropdown and subform 1 appears but if you choose 2 subform 2 appears and there is not white space where subform 1 was.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.

Duane Nickull

unread,
Feb 24, 2010, 12:13:54 PM2/24/10
to Adobe LiveCycle Developers
Highlight the subform or table
In the objects pane, select “Hidden – exclude from layout”
Once you make it visible, when you make it invisible again, reset the property to “Hidden – exclude from layout”

See attached.

Duane
Picture 48.png

renjith vijayan

unread,
Feb 24, 2010, 12:16:05 PM2/24/10
to live...@googlegroups.com
Hi,
you have to use layout property of the page as "Flowed" and not "Positioned".
Then it will work properly.

renjith vijayan

unread,
Feb 24, 2010, 1:11:25 PM2/24/10
to live...@googlegroups.com
please find the sample attached.


On Wed, Feb 24, 2010 at 10:39 PM, Worst, Debbie <dwo...@gaic.com> wrote:

Sample.pdf

Robert Phelan

unread,
Feb 24, 2010, 2:10:29 PM2/24/10
to live...@googlegroups.com
Is there any way to allow a user to copy an image, let's say a
screenshot, and paste it onto a form UI element?

Thanks,
Robert.

Sent from my iPhone


Worst, Debbie

unread,
Feb 24, 2010, 2:56:11 PM2/24/10
to live...@googlegroups.com
Thanks for the sample. Please excuse my lack of experience. I'm having a hard time understanding how to set up my form.

I have general information like,name, address, city, state that needs to show on the initial opening of the form and never hides. It is only when you select from the dropdown that below these fields the information should show or hide.

In your example you have everything in the same subform and that subform is flowed which I understand but I can't have all my fields, lining up on the left.

If you wouldn't mind, could you take a look at my form. Thanks,

-----Original Message-----
From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of renjith vijayan
Sent: Wednesday, February 24, 2010 1:11 PM
To: live...@googlegroups.com
Subject: Re: Form example with hidden fields based upon selection

please find the sample attached.


On Wed, Feb 24, 2010 at 10:39 PM, Worst, Debbie <dwo...@gaic.com> wrote:
> Yes and it hides dependent on what I select from the dropdown but there is "white space" where the subform used to be when you select an option that is in subform #2 or 3. What I want to do is you select 1 from the dropdown and subform 1 appears but if you choose 2 subform 2 appears and there is not white space where subform 1 was.
>
> -----Original Message-----
> From: live...@googlegroups.com [mailto:live...@googlegroups.com]
> On Behalf Of GL
> Sent: Wednesday, February 24, 2010 11:57 AM
> To: Adobe LiveCycle Developers
> Subject: Re: Form example with hidden fields based upon selection
>
> Do you have the table grouped as a subform?  And, have the subform "hidden-exclude from layout'?
>
> I am no expert, but have done some hiding.
>
> On Feb 24, 6:33 am, "Worst, Debbie" <dwo...@GAIC.COM> wrote:
>> Good morning!
>>
>> Does anyone have an example of how to set up a livecycle form where when you select a specific value from a dropdown, additional fields are exposed?
>>
>> I'm developing a form where you choose a value from a dropdown.  Upon the selection, a table with specific fields pertaining to your selection from the dropdown appear.  The problem I'm having is that there is white space where the table is when it is "hidden".
>>
>> Any help would be greatly appreciated...
>>
>> *********************************************************************

>> * The content of this e-mail message and any attachments are

JobSchedulingFlowed.pdf

Worst, Debbie

unread,
Feb 25, 2010, 8:06:22 AM2/25/10
to live...@googlegroups.com
Thank you so much for your example.

I do have the form now set up where it is not showing any white space.

I was now attempting to see how to write the following code in a "Switch Case" format. I have 6 options and was told that an else if statement would not be the best choice. Could anyone help me out with how to write this code in the Swtich Case format? Thanks in advance....

if (this.resolveNode("UC4Forms").rawValue == "New User Form")
{
this.resolveNode("SubFormNewUser").presence = "visible";
this.resolveNode("SubFormJobNumber").presence = "Hidden";
this.resolveNode("SubFormJobHold").presence = Hidden;
} else {

if (this.resolveNode("UC4Forms").rawValue == "Job Hold")
{
this.resolveNode("SubFormNewUser").presence = "hidden";
this.resolveNode("SubFormJobNumber").presence = "visible";
this.resolveNode("SubFormJobHold").presence = "visible";
} else {
if (this.resolveNode("UC4Forms").rawValue == "Run Request")
{
this.resolveNode("SubFormNewUser").presence = "hidden";
this.resolveNode("SubFormJobNumber").presence = "visible";
this.resolveNode("SubFormJobHold").presence = "visible";
} else {
if (this.resolveNode("UC4Forms").rawValue == "Job Hold")
{
this.resolveNode("SubFormNewUser").presence = "hidden";
this.resolveNode("SubFormJobNumber").presence = "visible";
this.resolveNode("SubFormJobHold").presence = "visible";
} else {


-----Original Message-----
From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of renjith vijayan
Sent: Wednesday, February 24, 2010 1:11 PM
To: live...@googlegroups.com

Subject: Re: Form example with hidden fields based upon selection

please find the sample attached.


On Wed, Feb 24, 2010 at 10:39 PM, Worst, Debbie <dwo...@gaic.com> wrote:
> Yes and it hides dependent on what I select from the dropdown but there is "white space" where the subform used to be when you select an option that is in subform #2 or 3. What I want to do is you select 1 from the dropdown and subform 1 appears but if you choose 2 subform 2 appears and there is not white space where subform 1 was.
>
> -----Original Message-----
> From: live...@googlegroups.com [mailto:live...@googlegroups.com]
> On Behalf Of GL
> Sent: Wednesday, February 24, 2010 11:57 AM
> To: Adobe LiveCycle Developers
> Subject: Re: Form example with hidden fields based upon selection
>
> Do you have the table grouped as a subform?  And, have the subform "hidden-exclude from layout'?
>
> I am no expert, but have done some hiding.
>
> On Feb 24, 6:33 am, "Worst, Debbie" <dwo...@GAIC.COM> wrote:
>> Good morning!
>>
>> Does anyone have an example of how to set up a livecycle form where when you select a specific value from a dropdown, additional fields are exposed?
>>
>> I'm developing a form where you choose a value from a dropdown.  Upon the selection, a table with specific fields pertaining to your selection from the dropdown appear.  The problem I'm having is that there is white space where the table is when it is "hidden".
>>
>> Any help would be greatly appreciated...
>>
>> *********************************************************************

>> * The content of this e-mail message and any attachments are

Duane Nickull

unread,
Feb 25, 2010, 10:20:26 AM2/25/10
to Adobe LiveCycle Developers
Add an image field.  See the attached document to see if it has the required functionality.

Duane
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.


AddImage.pdf

Robert Phelan

unread,
Feb 25, 2010, 10:24:17 AM2/25/10
to live...@googlegroups.com
Duane, 

Thanks a lot. I did see that functionality and think that would be our ultimate solution. However, I was hoping there was a way to directly paste the image without having to save it as a file.


Thanks,
Robert.

Sent from my iPhone
<AddImage.pdf>

Duane Nickull

unread,
Feb 25, 2010, 10:38:04 AM2/25/10
to Adobe LiveCycle Developers
PDF’s are by nature immutable with Reader other than form functionality and I am not aware of any way to access a clipboard object using JavaScript.  I’ll ask Jeff Stanier or someone on his team. The workflow of just clicking on it to add a picture is pretty common as an ask from customers.  

BTW – I ran into a slight bug on mine.  I took a photo using Apple Photobooth of me with some Olympic Ice Hockey TIX but there appears to be a white box in the middle of the photo.  Does this appear when others change the image?

Duane



On 2/25/10 7:24 AM, "Robert Phelan" <robp...@gmail.com> wrote:

Duane,

Thanks a lot. I did see that functionality and think that would be our ultimate solution. However, I was hoping there was a way to directly paste the image without having to save it as a file.

Thanks,
Robert.

Sent from my iPhone

On Feb 25, 2010, at 9:20 AM, Duane Nickull <dnic...@adobe.com> wrote:

Add an image field.  See the attached document to see if it has the required functionality.

Duane


On 2/24/10 11:10 AM, "Robert Phelan" <robp...@gmail.com <mailto:robp...@gmail.com> > wrote:

Is there any way to allow a user to copy an image, let's say a
screenshot, and paste it onto a form UI element?

Thanks,
Robert.

Sent from my iPhone


--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com <mailto:live...@googlegroups.com> .
To unsubscribe from this group, send email to livecycle+...@googlegroups.com <mailto:livecycle+...@googlegroups.com> .
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en <http://groups.google.com/group/livecycle?hl=en> .



---
Adobe LiveCycle Enterprise Architecture - http://www.adobe.com/products/livecycle/ <http://www.adobe.com/products/livecycle/>
My TV Show - http://tv.adobe.com/show/duanes-world/ <http://tv.adobe.com/show/duanes-world/>
My Blog – http://technoracle.blogspot.com/ <http://technoracle.blogspot.com/>  
My Band – http://22ndcenturyofficial.com/ <http://22ndcenturyofficial.com/>  
Twitter – http://twitter.com/duanechaos <http://twitter.com/duanechaos>
AddImage.pdf

Robert Phelan

unread,
Feb 25, 2010, 10:45:20 AM2/25/10
to live...@googlegroups.com
Duane, thanks for your input. It was really my idea to migrate this particular Word doc into Adobe Interactive forms(using SAP as our backend) and was trying to make the transition as seemless as possible - you know users...

They were used to pasting the image directly into the doc, however I think the interactivity I built in will far outweigh the minor inconvenience of saving the image prior to embedding it in the form.
 

Thanks,
Robert.

Sent from my iPhone
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.
<AddImage.pdf>

Robert Phelan

unread,
Feb 25, 2010, 10:48:42 AM2/25/10
to live...@googlegroups.com
Btw, when I change the image, it looks fine - the only white space I see is in the caption area or when an image's length/width don't fill up the image area.


Thanks,
Robert.

Sent from my iPhone
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.
<AddImage.pdf>

renjith vijayan

unread,
Feb 25, 2010, 11:33:18 AM2/25/10
to live...@googlegroups.com
tell me which are the fields u want to hide and display.
I think i can do it.....

renjith vijayan

unread,
Feb 25, 2010, 11:34:35 AM2/25/10
to live...@googlegroups.com
Please find the sample:

switch (expression){
case value1:
statement;
break;
case value2:
statement;
break;
"
"
default : statement;

Worst, Debbie

unread,
Feb 25, 2010, 11:48:21 AM2/25/10
to live...@googlegroups.com
Here is the code I have so far. I'm also having an issue that when the UC4Forms dropdown has New User Form as it's value, that I then go back to the dropdown and select Job Hold, New User values on the pdf are not hidden like they should be.

Thanks for you help....I really want to learn how to do this but I'm spending a lot of time just "spinning my wheels", so to speak.


if (this.resolveNode("UC4Forms").rawValue == "New User Form")
{
this.resolveNode("SubFormNewUser").presence = "visible";
this.resolveNode("SubFormJobNumber").presence = "Hidden";
this.resolveNode("SubFormJobHold").presence = Hidden;

this.resolveNode("SubFormRunRequest").presence = Hidden;
this.resolveNode("SubFormJobCancel").presence = Hidden;
this.resolveNode("SubFormJobRelease").presence = Hidden;
} else {

if (this.resolveNode("UC4Forms").rawValue == "Job Hold")
{
this.resolveNode("SubFormNewUser").presence = "hidden";
this.resolveNode("SubFormJobNumber").presence = "visible";
this.resolveNode("SubFormJobHold").presence = "visible";

this.resolveNode("SubFormRunRequest").presence = Hidden;
this.resolveNode("SubFormJobCancel").presence = Hidden;
this.resolveNode("SubFormJobRelease").presence = Hidden;
} else {

this.resolveNode("SubFormNewUser").presence = "hidden";

this.resolveNode("SubFormJobNumber").presence = "hidden";
this.resolveNode("SubFormJobHold").presence = "hidden";
this.resolveNode("SubFormRunRequest").presence = Hidden;
this.resolveNode("SubFormJobCancel").presence = Hidden;
this.resolveNode("SubFormJobRelease").presence = Hidden;

Jono Moore

unread,
Feb 25, 2010, 12:27:12 PM2/25/10
to Adobe LiveCycle Developers
Hi Debbie, here's a quick switch() example with your data.

You've got too many "this.resolveNode" going on in your code. "this"
refers to the current object.

An easy way to get the path to another object in Designer while
scripting is: with your cursor positioned in the script where you want
to reference another object, hold down the Ctrl key and mouse over the
field/subform that you want to reference - the mouse cursor will turn
into a "V" when you are over a valid object, then click and the
reference will be placed in your script.

I did that with the statements in your pdf and none of the
resolveNodes were needed.

Also, watch your spelling and punctuation - JavaScript is case-
sensitive, you had "hidden" spelled "Hidden" in one or two places
which won't work and you were missing some quotation marks.

this.rawValue = xfa.event.newText;
switch (this.rawValue) {
case "New User Form":
NewUserSubForm.presence = "visible";
JobNumberSubForm.presence = "hidden";
JobNumberSubForm.presence = "hidden";
break;
case "Job Hold":
NewUserSubForm.presence = "hidden";
JobNumberSubForm.presence = "visible";
JobHoldSubForm.presence = "visible";
break;

Worst, Debbie

unread,
Feb 25, 2010, 12:37:05 PM2/25/10
to live...@googlegroups.com
Thanks for your help and assistance.

I took your code and put it behind my dropdown named UC4Forms and tried to test it but nothing happened. I put it on the change event and I have it as JavaScript not Form Calc. What am I missing?

-----Original Message-----
From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of Jono Moore
Sent: Thursday, February 25, 2010 12:27 PM
To: Adobe LiveCycle Developers
Subject: Re: Form example with hidden fields based upon selection

--

Duane Nickull

unread,
Feb 25, 2010, 12:52:59 PM2/25/10
to Adobe LiveCycle Developers
Jono makes some great points.  Another way to make this the most efficient is to wrap the groups in subforms so each case only has two statements (one to hide and one to make visible).  The order also matters in switch-case so placing the most common choices near the top will result in faster code execution.

Jono – I’d love to get you to do a presentation one day for Adobe partners on this topic.

Duane
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.


Jono Moore

unread,
Feb 25, 2010, 1:02:37 PM2/25/10
to Adobe LiveCycle Developers
Oh, you need to save your form as "Adobe Dynamic XML Form" - you had
it saved as a static pdf.

> For more options, visit this group athttp://groups.google.com/group/livecycle?hl=en.

Jono Moore

unread,
Feb 25, 2010, 1:05:47 PM2/25/10
to Adobe LiveCycle Developers
On Feb 25, 9:52 am, Duane Nickull <dnick...@adobe.com> wrote:
> Jono - I'd love to get you to do a presentation one day for Adobe partners on this topic.

I can try, though I'm still somewhat a neophyte when it comes to
JavaScript. :)

Worst, Debbie

unread,
Feb 25, 2010, 1:04:48 PM2/25/10
to live...@googlegroups.com
I changed that also and it still isn't working.

For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.

Jono Moore

unread,
Feb 25, 2010, 1:34:18 PM2/25/10
to Adobe LiveCycle Developers
Hmm...not sure - it's working for me. You replaced the code on the
Change event with my code?

Under Form Properties also make sure that under the Preview tab
Preview Type is set to Interactive Form.

Worst, Debbie

unread,
Feb 25, 2010, 1:40:32 PM2/25/10
to live...@googlegroups.com
Yep.... I did exactly that.

I'll attach my form. I'd really appreciate another set of eyes. It's probably something really stupid on my part.

Really appreciate your patience.

> > ** The content of this e-mail message and any attachments are

For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.

workingflowedsubformsUC4.pdf

Duane Nickull

unread,
Feb 25, 2010, 1:47:06 PM2/25/10
to live...@googlegroups.com
I tried it and it did not display the subform fragments. Mac OSX 10.5
and Ubuntu 9.

D
********
22nd Century (my band) - http://22ndcenturyofficial.com/
Twitter - @duanechaos
Blog - http://technoracle.blogspot.com
********

>> The content of this e-mail message and any attachments are
>> confidential and may be legally privileged, intended solely for the
>> addressee. If you are not the intended recipient, be advised that any
>> use, dissemination, distribution, or copying of this e-mail is
>> strictly prohibited. If you receive this message in error, please
>> notify the sender immediately by reply email and destroy the message
>> and its attachments.
>> **********************************************************************
>
> --
> You received this message because you are subscribed to the Google
> Groups "Adobe LiveCycle Developers" group.
> To post to this group, send email to live...@googlegroups.com.
> To unsubscribe from this group, send email to livecycle+...@googlegroups.com
> .

> For more options, visit this group at http://groups.google.com/group/livecycle?hl=en
> .
>
>
>
>
> ********************************************************************** The

> content of this e-mail message and any attachments are confidential
> and may be legally privileged, intended solely for the addressee. If
> you are not the intended recipient, be advised that any use,
> dissemination, distribution, or copying of this e-mail is strictly
> prohibited. If you receive this message in error, please notify the
> sender immediately by reply email and destroy the message and its
> attachments.
> **********************************************************************
>
> --
> You received this message because you are subscribed to the Google
> Groups "Adobe LiveCycle Developers" group.
> To post to this group, send email to live...@googlegroups.com.
> To unsubscribe from this group, send email to livecycle+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/livecycle?hl=en
> .
>

> <workingflowedsubformsUC4.pdf>

Rick Kuhlmann

unread,
Feb 25, 2010, 2:04:43 PM2/25/10
to live...@googlegroups.com
Dear Gentle Form Designers,

I looked at the code and the problem is that the incorrect subforms are referenced.

this.rawValue = xfa.event.newText;
switch (this.rawValue) {
case "New User Form":

SubFormNewUser.presence = "visible";
SubFormJobNumber.presence = "hidden";
//JobNumberSubForm.presence = "hidden";//I am not sure which Subform this is
break;
case "Job Hold":
SubFormNewUser.presence = "hidden";
SubFormJobNumber.presence = "visible";
//JobHoldSubForm.presence = "visible";//I am not sure which Subform this is
break;
}

If you cut and paste this into the UC4Forms change event you will get the subforms to appear. Hopefully that will give you the keys to making the other code adjustments.

I would also like to state that as a 6 year user of Designer I really do not care for Tables. If I were designing this form I would have everything inside a Positioned Subform then wrap it in a Flowed Subform. When it is all said and done you get fewer objects in your Hierarchy to deal with.

Rick Kuhlmann
Sr. Adobe LiveCycle Developer
Tech-Pro, Inc.
www.tech-pro.com

Really appreciate your patience.


________________________________

This electronic mail (including any attachments) may contain information that
is privileged, confidential, and/or otherwise protected from disclosure to
anyone other than its intended recipient(s). Any dissemination or use of this
electronic email or its contents (including any attachments) by persons other
than the intended recipient(s) is strictly prohibited. If you have received
this message in error, please notify us immediately by reply email so that we
may correct our internal records. Please then delete the original message
(including any attachments) in its entirety. Thank you.

Jono Moore

unread,
Feb 25, 2010, 2:08:46 PM2/25/10
to Adobe LiveCycle Developers
Ah, you had renamed subforms since the earlier pdf I downloaded. ;)

You need to make sure the references match.

this.rawValue = xfa.event.newText;
switch (this.rawValue) {
case "New User Form":

SubFormNewUser.presence = "visible";
SubFormJobNumber.presence = "hidden";

// JobNumberSubForm.presence = "hidden"; // in twice?


break;
case "Job Hold":
SubFormNewUser.presence = "hidden";
SubFormJobNumber.presence = "visible";

SubFormJobHold.presence = "visible";
break;
}

>  workingflowedsubformsUC4.pdf
> 264KViewDownload

Worst, Debbie

unread,
Feb 25, 2010, 2:10:46 PM2/25/10
to live...@googlegroups.com
See, I told you it was something really stupid on my part..... Sometimes you really do just need another set of eyes. Thanks everyone for your help so far.

Hopefully I'll get better at this and will be able to help out also!

>  workingflowedsubformsUC4.pdf
> 264KViewDownload

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.

********************************************************************** The content of this e-mail message and any attachments are confidential and may be legally privileged, intended solely for the addressee. If you are not the intended recipient, be advised that any use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you receive this message in error, please notify the sender immediately by reply email and destroy the message and its attachments. **********************************************************************

Jono Moore

unread,
Feb 25, 2010, 2:12:50 PM2/25/10
to Adobe LiveCycle Developers
On Feb 25, 11:04 am, Rick Kuhlmann <rick.kuhlm...@tech-pro.com> wrote:
> I looked at the code and the problem is that the incorrect subforms are referenced.

Beat me to it!

> I would also like to state that as a 6 year user of Designer I really do not care for Tables. If I were designing this form I would have everything inside a Positioned Subform then wrap it in a Flowed Subform. When it is all said and done you get fewer objects in your Hierarchy to deal with.

I'm with you there, tables can be a real pain.

Reply all
Reply to author
Forward
0 new messages