mathmatical validation - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

mathmatical validation

Last post 02-15-2011 09:00 AM by tafavorite. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 02-04-2011 05:58 AM

    mathmatical validation

    Okay, for the math wizzes. I have a group of check boxes that I have gotten so you have to choose one and untill you choose one, they have a red box around them. That is one section. In a second section of the form I have 3 more check boxes. What I need is some validation or rule that would make it so if you check on one check box from the first group it will check to make sure you have selected at least 2 of the 3 checkboxes from the second group. I am aware of the only 5 conditions per rule so I think I am getting much for one rule and would have to split into multiple rules. I am just having trouble trying to get the rule to read if you check one box then you need to check 2 from 3 of the next group. Any thoughts or examples of how to step by step process to create the rule would be terrific.

  • 02-04-2011 07:25 AM In reply to

    I'm confused about your situation.  You say that you have validation so that the user has to check a checkbox from the first set, but then you say if the user checks a box in the first group, then they have to check at least 2 from the second group.  Wouldn't they always have to choose at least 2 from the second group because they always have to check at least one from the first group?  Or did you mean to imply that the user doesn't need to pick any from the second group if they choose more than one in the first group?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-04-2011 08:23 AM In reply to

    Okay, let me see if I can lay this out.
    First the user has a choice to choose any one of 5 checkboxes
                     (Which has a valdation on these checkboxes because the user must choose 1, which I had gotten the code from a previous post on how to do this).

    Second, if the user selects First check box, there is a second question that has 3 additional checkboxes. The user must select one from there. I got that one done.

    The tricky part is here. If the user selects the 2 or 3 check box from the original group of 5, then the second question needs to be required that the user selects 2 checkboxes from that question.

     I really would need the help with expressions and what you need to put in the conditional statements for infopath to check that these checkboxes are correctly done.

    I hope this is able to be explained better. Not sure what else I can say.

  • 02-04-2011 08:34 AM In reply to

    Please have a look at the validation expressions on this form.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-04-2011 08:40 AM In reply to

    WOW. That is awsome, exactly what I needed. thank you so much!

  • 02-15-2011 07:05 AM In reply to

    Have a problem now. The value for the the checkboxes had to be set to the wording that is associated with them so now they are no longer able to "=1" in your example. So, what can I do to still use this validation but replace the 1 with the checkbox value.

    Situtation:

    chkbx : Take me out
    chkbx : Take me to the game
    chkbx : Take me to the resturant

    so now the chkbx has the following values

    cleared = 0
    checked = Take me out

    cleared = 0
    checked = Take me to the game

    So, can I add those in place of 1 in the conditional statement of the first expression seperated by commas...?

    count((../my:Take_me_out | ../my:Take_me_to_game| ../my:Take_me_to_resturant)[. = "1"]) < 2

  • 02-15-2011 08:06 AM In reply to

    I think it would be wiser to keep the true/false values on your checkboxes, and put rules on them to set a separate field to the value you want, accordingly. That way you don't have to incorporate those text values (which might yet change again) into your logic conditions.  And if

    it's just a matter of displaying that text in the form, it could make sense just to use expression boxes with conditional formatting to show those values.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-15-2011 09:00 AM In reply to

    I am trying to follow what you’re saying, and it sounds a lot better than what is being done now. I am just not following on how to accomplish this. If you could explain a little more and give an example using the above info I could further understand. Situation:We have checkboxes and radio buttons. The hope is that in the future when one of these forms are submitted that the form will go to a database and from there different departments could access the database and pull the information from this form. Good example is that if someone clicks a yes or no radio button, then when the form is submitted it goes to the database with yes or no value instead of 1 or 2.

    What I am understanding, from your answer is that the process is still accomplished but in a different form. If you could explain it better, then I could understand a bit better.

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.