data validation on form load - InfoPath Dev
in

InfoPath Dev

data validation on form load

Last post 11-23-2010 11:13 AM by khurram. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-13-2010 01:33 PM

    data validation on form load

    Hi, I am trying to validate a form using rules in infopath 2010. For example if I have a required field I add a rule "Is blank" and then change formatting to bad. It works fine except the validation is performed as soon as the form is loaded, even before the user has submitted the form by clicking on a button. Am I missing something? Is there a way to trigger validation only once the user clicks on the submit button? thanks, Khurram
    Filed under:
  • 10-13-2010 03:37 PM In reply to

    Re: data validation on form load

    Generally, you want to make sure your form is valid prior to submitting. Why would you want to submit XML if a required field is still blank? If your validation needs to be more complex, you could have a field in your form that maintains the form state -- when the user clicks the submit button, for example, you could set that field to "Submitted". Then your data validation could also take that field into account -- if fieldA is blank and formState is "Submitted"....
    Hilary Stoupa

  • 10-14-2010 07:41 AM In reply to

    Re: data validation on form load

    i do not want to submit a form if its not valid, but i also do not want controls to show up red and with validation messages as soon as the form is loaded. what i want is that validation only happens once the user starts filling in the controls. Like if i have a required field validation on a textbox it should only show red if a user tabs through it without filling it in. An empty form should not show up all red and with validation messages on load.
  • 10-14-2010 11:12 AM In reply to

    Re: data validation on form load

    You'll need to do some custom validation, then, based on whether the field is blank and another field with some value that you can use to try to determine user intent (i.e. -- user clicked submit button when the field was blank) instead of using the built in "can't be blank" option on fields.

    I'm going to have to say, though that while I understand where you are coming from, this isn't an approach I agree with. At one point, I also didn't like marking fields as invalid if the user hasn't had a chance to fill them out. In the end, though, I've decided that having a red asterisk display on the "can't be blank" fields is what people are used to -- lots of online forms are that way, and it is actually easier to fill them out, because I'm not left guessing what is required.

    Hilary Stoupa

  • 11-23-2010 11:13 AM In reply to

    Re: data validation on form load

    I agree with you Hilary, for asterisk showing up its ok, but if you have radio button group in your form, without any default selection, and they cannot be blank, there is red boxes that appear around them which is very annoying indeed and make forms look very weired. I have never seen online forms displayed like this. I do not understand why the infopath form validation doesn't work like asp.net validation controls and why we do not have control over it. I am using brower-enabled forms.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.