<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Logic to blank controls</title><link>https://www.infopathdev.com:443/forums/thread/9561.aspx</link><pubDate>Thu, 20 Apr 2006 05:30:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9561</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9561.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9561</wfw:commentRss><description>Hi Ryan,&lt;br /&gt;My suggestion would be to not do this in code but use rules. Office 2007 will have a cool logic inspector tool that will make navigating rules easier (chief complaint today is they are hard to debug).</description></item><item><title>Re: Logic to blank controls</title><link>https://www.infopathdev.com:443/forums/thread/9560.aspx</link><pubDate>Mon, 17 Apr 2006 23:06:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9560</guid><dc:creator>rzwahr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9560.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9560</wfw:commentRss><description>Matt,&lt;br /&gt;Sorry, I am really not trying to ask for an e-handout.  I am just trying to get an idea of what's required.  You've given me enough information to get me started - thanks.&lt;br /&gt;&lt;br /&gt;Ryan</description></item><item><title>Re: Logic to blank controls</title><link>https://www.infopathdev.com:443/forums/thread/9559.aspx</link><pubDate>Mon, 17 Apr 2006 22:14:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9559</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9559.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9559</wfw:commentRss><description>This should be relatively easy to do in code. It sounds like you need to put code in the OnAfterChange events of the textboxes. To do this, double-click the node from the Data Source task pane and change to the Data Validation tab. At the bottom select OnAfterchange and then click Edit Code...&lt;br /&gt;&lt;br /&gt;Besides this, do you have any code that you have started on that we can debug? We can't write the whole thing for you!</description></item><item><title>Logic to blank controls</title><link>https://www.infopathdev.com:443/forums/thread/5534.aspx</link><pubDate>Mon, 17 Apr 2006 20:12:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5534</guid><dc:creator>rzwahr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5534.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5534</wfw:commentRss><description>I am looking for a way to make sure the value of a control is blank if the control gets hidden.  Based on what I have seen so far, if you hide a control, for example a textbox, and you have already typed something in it, when the control gets hidden, the value is still there.  I have a lot of conditional logic in the form I am working on, and when the user selects certain options, I need to ensure that the fields that get hidden as a result have their values set to zero.&lt;br /&gt;&lt;br /&gt;Here's what I am trying to do basically:&lt;br /&gt;&lt;br /&gt;1) Check the value of a field.&lt;br /&gt;2) If the value of the field is "New", then show Textbox A and Textbox B and make sure Textbox C and Textbox D are blank.&lt;br /&gt;3) If the value of the field is "Upgrade", do the opposite of 2.&lt;br /&gt;&lt;br /&gt;So I want to be able to do the following with code:&lt;br /&gt;&lt;br /&gt;1) show and hide controls based on the value of a field.&lt;br /&gt;2) set the value of a field, based on the value of another field.&lt;br /&gt;&lt;br /&gt;I know it can be done with rules and conditional formatting, but I'd rather do it in code if I can.&lt;br /&gt;&lt;br /&gt;My biggest problem here is I am not sure how to reference objects on the form within jscript, nor do I know how to reference fields to check their values.  I prefer to do as little as possible with rules, etc, and do almost all of this in code.  I don't see any really clear cut examples of this anywhere (I am very new to Infopath, so I may be missing it completely).&lt;br /&gt;&lt;br /&gt;Is there an efficient way to do these operations in code?  I am making the assumption that if a rule can do it or if conditional formatting can do it, it can be done in code.  If so can someone please provide an example (I will be using jscript) or point me to some that are out there.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Ryan</description></item></channel></rss>