locked
Resetting the default value of a control when a check box is returned to False (unchecked) RRS feed

  • Question

  • Let me start by saying I’m new at programming InfoPath and I value the advice I have found in this forum. Thank you...

     Here’s my situation: I have an InfoPath 2007 form that populates a SharePoint list once the form is submitted. On the form I have various textboxes that are conditionally formatted to remain hidden until an associated checkbox is checked (value of True).  All is good so far. 

    The situation I have is if the user decides after populating a textbox they really didn’t need to fill in that textbox and the checkbox is unchecked (value of False), the textbox is hidden once again but the information remains in the textbox.  Thus, when the user submits the form the unneeded information is submitted as well.  

    I would think returning a textbox control to its default value could be accomplished with conditional formatting much like it is hidden however; I haven’t been able to figure it out. Has anyone run into something like this and how did you overcome the problem? Or does anyone have an example I could run with? 

    Thank you for any support

    Friday, May 20, 2011 12:40 PM

Answers

  • Thank you Clayton for getting me to view it from the checkbox controlling the action. I was fixed on controlling this from the textbox.

    It works great, here’s how it panned out just in case there’s someone out there who would like to know how it was done. Don’t want to insult anybody’s intellect, I figured I’m probably not the only who would want to know.

    1.       From the Data tab in the check box properties I clicked the Rules button

    2.       Then click the Add button in Rules window

    3.       Then clicked Set Condition button in the Rule window – left the rule name as the default “rule 1”

    4.       The condition was   Checkbox -  is equal to – False

    5.       Then clicked the Added Action button 

    6.       From the Action window dropdown I picked Set a Fields Value

    7.        In the “Field” area I mapped to textbox I needed to reset to default value of blank

    8.        In the “Value” area I clicked the fx- formula button

    9.       In the formula window, click the Insert a Field or Group button

    10.   Single click on the textbox in the Main Data source

    11.   Click the “Filter Data” button

    12.   Click Add

    13.   Set the filter conditions to Textbox - is equal to – “” or blank

    14.   Start clicking the Ok buttons until you’ve baked out to the properties window and click Apply before exiting properties.

    Thanks again,

    Tom
    • Marked as answer by TWarmoth Monday, May 23, 2011 2:48 AM
    Monday, May 23, 2011 2:48 AM
  • Just fire a rule on the check box that says, "If CheckBoxValue is equal to No/False/Whatever, then set TextBox to null (blank)."  No problem, right?
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by TWarmoth Friday, May 20, 2011 6:54 PM
    Friday, May 20, 2011 4:40 PM

All replies

  • Just fire a rule on the check box that says, "If CheckBoxValue is equal to No/False/Whatever, then set TextBox to null (blank)."  No problem, right?
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by TWarmoth Friday, May 20, 2011 6:54 PM
    Friday, May 20, 2011 4:40 PM
  • Thank you Clayton for getting me to view it from the checkbox controlling the action. I was fixed on controlling this from the textbox.

    It works great, here’s how it panned out just in case there’s someone out there who would like to know how it was done. Don’t want to insult anybody’s intellect, I figured I’m probably not the only who would want to know.

    1.       From the Data tab in the check box properties I clicked the Rules button

    2.       Then click the Add button in Rules window

    3.       Then clicked Set Condition button in the Rule window – left the rule name as the default “rule 1”

    4.       The condition was   Checkbox -  is equal to – False

    5.       Then clicked the Added Action button 

    6.       From the Action window dropdown I picked Set a Fields Value

    7.        In the “Field” area I mapped to textbox I needed to reset to default value of blank

    8.        In the “Value” area I clicked the fx- formula button

    9.       In the formula window, click the Insert a Field or Group button

    10.   Single click on the textbox in the Main Data source

    11.   Click the “Filter Data” button

    12.   Click Add

    13.   Set the filter conditions to Textbox - is equal to – “” or blank

    14.   Start clicking the Ok buttons until you’ve baked out to the properties window and click Apply before exiting properties.

    Thanks again,

    Tom
    • Marked as answer by TWarmoth Monday, May 23, 2011 2:48 AM
    Monday, May 23, 2011 2:48 AM
  • Thank you very much Tom. This is what I was looking for.

    It works great for me. :)

    Thursday, October 16, 2014 7:48 AM