<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: What About the Other Field?</title>
	<atom:link href="http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/feed/" rel="self" type="application/rss+xml" />
	<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/</link>
	<description>Building intelligent forms using Adobe LiveCycle Designer</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:32:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6819</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Thu, 17 Jun 2010 01:57:02 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6819</guid>
		<description>@Michael Newson,

I would suggest that you use an IF statement in the numeric field&#039;s Calculate script:

&lt;pre&gt;&lt;code&gt;// JavaScript:
if (CheckBox1.rawValue == &quot;1&quot;)
{
    this.rawValue = 0; // set to zero
}
else
{
    // do the normal calculation here
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Michael Newson,</p>
<p>I would suggest that you use an IF statement in the numeric field&#8217;s Calculate script:</p>
<pre><code>// JavaScript:
if (CheckBox1.rawValue == "1")
{
    this.rawValue = 0; // set to zero
}
else
{
    // do the normal calculation here
}</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Newson</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6818</link>
		<dc:creator>Michael Newson</dc:creator>
		<pubDate>Mon, 07 Jun 2010 10:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6818</guid>
		<description>Quick question: I&#039;m trying to do something very simple, but I&#039;m having the hardest time figuring out how to do it correctly.

I have a checkbox field that when checked, I would like a numerical field to go to zero.  The complicated part is that this numerical field is a calculated field (it automatically calculates shipping cost), and if the customer doesn&#039;t check the box, I would like the normal calculation to take place.

I figured that I could use a simple &quot;if...then&quot; statment, but I think my programming skills are rusty, so I&#039;m struggling.

I&#039;m trying to do this in Adobe LiveCycle Designer 8.0.

Any suggestions?</description>
		<content:encoded><![CDATA[<p>Quick question: I&#8217;m trying to do something very simple, but I&#8217;m having the hardest time figuring out how to do it correctly.</p>
<p>I have a checkbox field that when checked, I would like a numerical field to go to zero.  The complicated part is that this numerical field is a calculated field (it automatically calculates shipping cost), and if the customer doesn&#8217;t check the box, I would like the normal calculation to take place.</p>
<p>I figured that I could use a simple &#8220;if&#8230;then&#8221; statment, but I think my programming skills are rusty, so I&#8217;m struggling.</p>
<p>I&#8217;m trying to do this in Adobe LiveCycle Designer 8.0.</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sblanco</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6817</link>
		<dc:creator>sblanco</dc:creator>
		<pubDate>Wed, 08 Apr 2009 22:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6817</guid>
		<description>Hi Stefan,

Works great! I really appreciate your help &quot;).

Thank you very much!!</description>
		<content:encoded><![CDATA[<p>Hi Stefan,</p>
<p>Works great! I really appreciate your help &#8220;).</p>
<p>Thank you very much!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6816</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Sun, 05 Apr 2009 22:22:10 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6816</guid>
		<description>sblanco,

In my &lt;a href=&quot;http://forms.stefcameron.com/2006/06/26/process-all-fields/&quot; rel=&quot;nofollow&quot;&gt;ProcessAllFields script&lt;/a&gt;, just change the first part to this:

&lt;pre&gt;&lt;code&gt;if (oNode.className == &quot;exclGroup&quot; &#124;&#124; oNode.className == &quot;subform&quot;  &#124;&#124; oNode.className == &quot;subformSet&quot; &#124;&#124; oNode.className == &quot;area&quot;)
{
    // Look for child fields unless it&#039;s a hidden subform.
    if (oNode.className == &quot;subform&quot; &amp;&amp; oNode.presence != &quot;visible&quot;)
        return;

    for (var i = 0; i &lt; oNode.nodes.length; i++)
    {
        var oChildNode = oNode.nodes.item(i);
        ProcessAllFields(oChildNode);
    }
}
else if (oNode.className == &quot;field&quot;)
...&lt;/code&gt;&lt;/pre&gt;

Notice the new statement inside the first IF that checks to see if the node is a subform and if it isn&#039;t visible (if those conditions are met, the function doesn&#039;t look inside).</description>
		<content:encoded><![CDATA[<p>sblanco,</p>
<p>In my <a href="http://forms.stefcameron.com/2006/06/26/process-all-fields/" rel="nofollow">ProcessAllFields script</a>, just change the first part to this:</p>
<pre><code>if (oNode.className == "exclGroup" || oNode.className == "subform"  || oNode.className == "subformSet" || oNode.className == "area")
{
    // Look for child fields unless it's a hidden subform.
    if (oNode.className == "subform" &#038;&#038; oNode.presence != "visible")
        return;

    for (var i = 0; i < oNode.nodes.length; i++)
    {
        var oChildNode = oNode.nodes.item(i);
        ProcessAllFields(oChildNode);
    }
}
else if (oNode.className == "field")
...</code></code></pre>
<p>Notice the new statement inside the first IF that checks to see if the node is a subform and if it isn't visible (if those conditions are met, the function doesn't look inside).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sblanco</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6815</link>
		<dc:creator>sblanco</dc:creator>
		<pubDate>Fri, 03 Apr 2009 21:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6815</guid>
		<description>Hi Stefan,

I&#039;m new to LiveCycle...trying to create a form and I used one of your sample scripts (ProcessAllFields.js) in validating mandatory fields.  It works good. I only have one problem... I have a subform that has a textfield that is mandatory, but this subform is hidden.  This will only show if I select a checkbox..

Example:  if checkbox.rawvalue==1
              { subform.presence = &quot;visible&quot;;}
              else
              {subform.presence=&quot;hidden&quot;;}

Now the sample script I used is also checking the textfield inside the subform even the subform is hidden.  I tried adding in the script if there are any hidden fields or subform it will be skip... But I guess I do not have the experience to make it work. Do you have any suggestions? Any help at all would be really appreciated.</description>
		<content:encoded><![CDATA[<p>Hi Stefan,</p>
<p>I&#8217;m new to LiveCycle&#8230;trying to create a form and I used one of your sample scripts (ProcessAllFields.js) in validating mandatory fields.  It works good. I only have one problem&#8230; I have a subform that has a textfield that is mandatory, but this subform is hidden.  This will only show if I select a checkbox..</p>
<p>Example:  if checkbox.rawvalue==1<br />
              { subform.presence = &#8220;visible&#8221;;}<br />
              else<br />
              {subform.presence=&#8221;hidden&#8221;;}</p>
<p>Now the sample script I used is also checking the textfield inside the subform even the subform is hidden.  I tried adding in the script if there are any hidden fields or subform it will be skip&#8230; But I guess I do not have the experience to make it work. Do you have any suggestions? Any help at all would be really appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6814</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Sat, 28 Mar 2009 17:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6814</guid>
		<description>rpeterson,

The messageBox function doesn&#039;t let you add UI controls to it like radio buttons. If you want to use messageBox, then then best you can do is instruct the user to click &#039;yes&#039; for one thing, &#039;no&#039; for another and &#039;cancel&#039; for the third option.

In this case, you would use the following script:

&lt;pre&gt;&lt;code&gt;// JavaScript:
switch (xfa.host.messageBox(&quot;Choose an option:\nyes: option 1\nno: option 2\ncancel: option 3&quot;, &quot;Option Dialog&quot;, 2, 3)
{
    case 4:
        // user clicked &#039;yes&#039;
        break;
    case 3:
        // user clicked &#039;no&#039;
        break;
    case 2:
        // user clicked &#039;cancel&#039;
        break;
    default:
        break;
}&lt;/code&gt;&lt;/pre&gt;

Another option is to use the xfa.host.response() function. In this case, you would instruct the user to enter the number corresponding to the option they want to select in the message box that appears (it&#039;ll have a single entry field):

&lt;pre&gt;&lt;code&gt;// JavaScript:
var answer = xfa.host.response(&quot;Choose an option by entering the corresponding number in the box below and pressing &#039;OK&#039;:\n1: option 1\n2: option 2\n3: option 3&quot;, &quot;Option Dialog&quot;, &quot;&quot; /*can set default answer here*/, false);
if (answer == null)
{
    // user clicked &#039;cancel&#039; instead of &#039;ok&#039;
}
else
{
    switch (parseInt(answer))
    {
        case 1:
            // user chose 1
            break;
        case 2:
            // user chose 2
            break;
        case 3:
            // user chose 3
            break;
        default:
            // invalid option!
            break;
    }
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>rpeterson,</p>
<p>The messageBox function doesn&#8217;t let you add UI controls to it like radio buttons. If you want to use messageBox, then then best you can do is instruct the user to click &#8216;yes&#8217; for one thing, &#8216;no&#8217; for another and &#8216;cancel&#8217; for the third option.</p>
<p>In this case, you would use the following script:</p>
<pre><code>// JavaScript:
switch (xfa.host.messageBox("Choose an option:\nyes: option 1\nno: option 2\ncancel: option 3", "Option Dialog", 2, 3)
{
    case 4:
        // user clicked 'yes'
        break;
    case 3:
        // user clicked 'no'
        break;
    case 2:
        // user clicked 'cancel'
        break;
    default:
        break;
}</code></pre>
<p>Another option is to use the xfa.host.response() function. In this case, you would instruct the user to enter the number corresponding to the option they want to select in the message box that appears (it&#8217;ll have a single entry field):</p>
<pre><code>// JavaScript:
var answer = xfa.host.response("Choose an option by entering the corresponding number in the box below and pressing 'OK':\n1: option 1\n2: option 2\n3: option 3", "Option Dialog", "" /*can set default answer here*/, false);
if (answer == null)
{
    // user clicked 'cancel' instead of 'ok'
}
else
{
    switch (parseInt(answer))
    {
        case 1:
            // user chose 1
            break;
        case 2:
            // user chose 2
            break;
        case 3:
            // user chose 3
            break;
        default:
            // invalid option!
            break;
    }
}</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: rpeterson</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6813</link>
		<dc:creator>rpeterson</dc:creator>
		<pubDate>Mon, 23 Mar 2009 17:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6813</guid>
		<description>Stefan,

I have just found this site!!  It appears to be equally informative when compared to the user forum for adobe.  I am sooo jazzed!!

I am fairly new to adobe/lc, and have absolutely no programming experience at all, but can learn from examples and reading reference materials.

Now for my question...

Can I set up a messageBox to give a list of radio buttons to allow a user to select from a list of statements, then once selected (click a radiobutton, then click OK) to provide that selection in a field that if it is too long to print on a single line to show wrapped?

I tried using the messageBox to select a yes/no/cancel to have either a static text or text field show when either yes or no was selected, but somehow I do not have the experience to make it work.  Do you have any suggestions?  Any help at all would be really appreciated.

Thanks, rpeterson</description>
		<content:encoded><![CDATA[<p>Stefan,</p>
<p>I have just found this site!!  It appears to be equally informative when compared to the user forum for adobe.  I am sooo jazzed!!</p>
<p>I am fairly new to adobe/lc, and have absolutely no programming experience at all, but can learn from examples and reading reference materials.</p>
<p>Now for my question&#8230;</p>
<p>Can I set up a messageBox to give a list of radio buttons to allow a user to select from a list of statements, then once selected (click a radiobutton, then click OK) to provide that selection in a field that if it is too long to print on a single line to show wrapped?</p>
<p>I tried using the messageBox to select a yes/no/cancel to have either a static text or text field show when either yes or no was selected, but somehow I do not have the experience to make it work.  Do you have any suggestions?  Any help at all would be really appreciated.</p>
<p>Thanks, rpeterson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Melissa Templeton</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6812</link>
		<dc:creator>Melissa Templeton</dc:creator>
		<pubDate>Tue, 28 Oct 2008 14:30:27 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6812</guid>
		<description>Thanks Stefan. I really apprecaite your assistance. =) Looks great!</description>
		<content:encoded><![CDATA[<p>Thanks Stefan. I really apprecaite your assistance. =) Looks great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Cameron</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6811</link>
		<dc:creator>Stefan Cameron</dc:creator>
		<pubDate>Fri, 24 Oct 2008 19:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6811</guid>
		<description>Melissa Templeton,

I see. What you need to do is handle the Change event on the drop down list. In the event, look at the xfa.event.newText property which will be set to the new selection. Note that if you list items have text and value data that differ and you need the value data, you&#039;ll need to use the boundItem list function on the newText value to get it:

&lt;pre&gt;&lt;code&gt;var newSelection = xfa.event.newText;
var boundValue = this.boundItem(newSelection); // to get the value data associated with the new selected item, if you need it

if (boundValue == &quot;yes&quot;)
    this.fillColor = &quot;255,0,0&quot;;
else
    this.fillColor = &quot;255,255,255&quot;;&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Melissa Templeton,</p>
<p>I see. What you need to do is handle the Change event on the drop down list. In the event, look at the xfa.event.newText property which will be set to the new selection. Note that if you list items have text and value data that differ and you need the value data, you&#8217;ll need to use the boundItem list function on the newText value to get it:</p>
<pre><code>var newSelection = xfa.event.newText;
var boundValue = this.boundItem(newSelection); // to get the value data associated with the new selected item, if you need it

if (boundValue == "yes")
    this.fillColor = "255,0,0";
else
    this.fillColor = "255,255,255";</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Melissa Templeton</title>
		<link>http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6810</link>
		<dc:creator>Melissa Templeton</dc:creator>
		<pubDate>Fri, 24 Oct 2008 19:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/#comment-6810</guid>
		<description>Stefan,

I looked over your article; however I am still unsure as to how to only fill the field when &#039;Yes&#039; is selected. If &#039;No&#039; is selected, I do not want the field to appear as colored.

Maybe I am just having &quot;a blonde moment&quot;.

Thanks!
Melissa</description>
		<content:encoded><![CDATA[<p>Stefan,</p>
<p>I looked over your article; however I am still unsure as to how to only fill the field when &#8216;Yes&#8217; is selected. If &#8216;No&#8217; is selected, I do not want the field to appear as colored.</p>
<p>Maybe I am just having &#8220;a blonde moment&#8221;.</p>
<p>Thanks!<br />
Melissa</p>
]]></content:encoded>
	</item>
</channel>
</rss>

