Using controls: How to check of all questions answered of a form view? - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Using controls: How to check of all questions answered of a form view?

Last post 08-29-2012 09:30 PM by Gennady Vanin (Геннадий Ванин, Новосибирск). 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 11-10-2011 12:50 PM

    Using controls: How to check of all questions answered of a form view?

    I am creating a mult-view form, essentially with multiple pages. I want to set the value of a control at the bottom of each page to "Section Complete" when all of the questions have been answered on each page/sections. I''ve tried a few options will little success. Any ideas? I need to do this will rules or formulas of some type. Assume all of the questions are radio buttons.

  • 11-29-2011 07:55 AM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Here is one way. Assuming that all radio buttons are blank (=0). In a text box put a formula to sum all of the radio buttons. If the value of the text box is "not equal to" "0" or "is greater than" "0" use a rule to set your control to "section complete". Set the conditional formatting on the textbox to "if present""Hide this control".
  • 11-30-2011 02:50 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Another option would be a calculated value with conditional formatting. Just have to add all the conditions for hiding it.
    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 11-30-2011 03:00 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Thanks for answering. One method that I have been testing is to have all controls on the page view with no answer to have a value set to zero, then when user answers change the value to 1. I then add the values at the end of each page and if the total = number of questions, then i mark page complete. Is this a good way?

  • 11-30-2011 03:17 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Perfect, if that works for your scenario - this means that your data (XML) contains just 0 & 1 - depending on your XML structure, there's a chance your data wouldn't make sense without the form.

    For example - let's say you didn't get around to renaming your fields - so they are all "field1", "field2" and so on (not that you'd do that).

    Your XML would look like:

    <myFields>
         <field1>1</field1>
         <field2>0</field2>
    </myFields>

    Not terribly meaningful. And then, let's say your questions are on your template - "Were you on time?", "Did you like the show?". If you modify your template to change the questions, you'd have no way of knowing what the user was originally answering.

    So, while I like the idea of using 0/1 and summing - it is clean and efficient! there are some concerns you need to be aware of.

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 11-30-2011 03:23 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Normally when you insert the radio buttons the first one will have a value of "1" the second "2" and so on. So if what you are saying is that you would add the values of the radio buttons and expect them to add up to the number of questions I don't think this would work as any buttons with a value of more than one would throw off your calculation.

  • 11-30-2011 03:39 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    More like this. I have two controls on the form:

    What is your gender with two radio buttions (control name = gender)

    What is your age? text box with control name of "age"

    For the gendor control, I set a rule like, if gender isblank then set value of gender_ctr = 0, if not blank then value of 1 (I created a counter field for each answer control), basically same process for the age text box, if blank then counter value = 0, or if not blank then 1.

     I then sum all the page counter and if equal to the page/view total then i show a field what states "PAGE COMPLETE". It works but maybe there is an easier way. I have about 10 questions on each view. At then end of all of the pages, i ahve a summary page which shows that status of each page and whether each page is complete. If not, the user can link back to the needed view. Once complete then they can submit the form.

     If there is a better / easier way, I'm all ears. Thanks.

     

  • 11-30-2011 04:11 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Yeah, I'd probably just have used an expression box (calculated value) and hidden it if any of the fields I've got on the view are blank. I've attached a simple sample form. Save it locally, right click the file and open in design mode. From there preveiw - if you put a value in every field, you'll see the expression box. You'll see I've got all my conditions in a single formatting rule - by using "the expression" you can get around the UI limit of 5 conditions per rule.

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 08-29-2012 09:30 PM In reply to

    Re: Using controls: How to check of all questions answered of a form view?

    Hilary,

    thanks. This was nontrivial (sample.xsn)

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
Page 1 of 1 (9 items)
Copyright © 2003-2012 Qdabra Software. All rights reserved.
View our Terms of Use.