Problem: Validation with Rules - InfoPath Dev
in

InfoPath Dev

Problem: Validation with Rules

Last post 11-24-2012 11:06 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-20-2012 08:17 AM

    Problem: Validation with Rules

    Scenario
    Browser based form in MOSS2007.

    View 1
    Two buttons
    - Button 1 - Submit form and go to View 2
    - Button 2 - Submit form and go to View 3

    One text field
    - The text field is associated with Button 1
    - The text field must contain content to be able to use Button 1
    - There is no requirement for text to be entered to use Button 2

    - A formatting rule is used for Button 1 (Condition: text field is blank, Formatting: Disable this control).
    - Because two submit buttons exist and only one requires content the standard "Cannot be blank" property on the text box is not usable.


    Problem
    It appears the standard behaviour of InfoPath in this scenario is that InfoPath requires that the user must click outside of the text box after entering text for the rule validation to take place and the button to be made available. This is contrary to percieved "normal" behaviour of non-InfoPath web fields requiring text where as soon as text is entered the button is available.

    Desired Behaviour
    As soon as the user adds content to the text box the button becomes avialable.

    Q: How can we achieve the desired behaviour??

  • 11-24-2012 11:06 AM In reply to

    Re: Problem: Validation with Rules

    Hi A.Goodwin and thanks for posting,

    You're right that the InfoPath eventing model requires that focus move out of the control before validation takes place.

    InfoPath has an option in the text box properties to automatically move to the next field when a certain number of characters are type in. This can be used to provide validation for UPC scanners etc. Probably won't work for you though since you have variable length text.

    I recommend just using an optional section in your form with static red text saying that the text box needs to be filled in. You can put this under the button. You can have two buttons for Button 1. First button is "Confirm" and that has the effect of validating the field since when they click it the focus is changed and then the optional guidance text section will disappear and I would hide the Confirm button based on the same condition and then display a Submit button. Which will now succeed since the text field is now valid.

    Just some random ideas to help you workaround the limits ...

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.