How can I validate a number in a single Matrix text box (cell)?

  • Profile Image
    Asked on July 08, 2015 at 05:06 PM
    Also, I want to validate the numbers in a matrix text box, so that the teachers cannot make a mistake inputting the numbers.  For instance, I have 5 columns across,  1, 1, 2, 3, 4.  They cannot fill in a 4, into a column header of 1.  I would like an error to appear if that happens.  Is this possible?  I tried the tools in conditions, but I am done playing, and I would appreciate an answer.  Thanks so much!  Cathy
  • Profile Image
    Answered on July 08, 2015 at 05:26 PM

    To do this, you would need to add the field into the Form Calculation.

    When you do, you will be shown the option to select which exact cell you would like to include (or cells), but in your case, you should select one of the cells that work best for you and have a validation for each cell set up accordingly.

    You can see how to add the Form Calculation widget to your form here: How to Add a Widget to your Form

    Once you set the form calculations, you can hide them by clicking on the gear wheel icon on them and selecting Hide Field option:

    The last piece of the puzzle is to set up the conditions to show an error or hide submit button if the field is not filled out properly.

    For example, I would add Text element to the form that is to be shown on such occasions.

    You can see more about the conditions here: Smart Forms Using Conditional Logic and here: How to show or hide a field in the form based on the other field input or selection

    We are of course here Cathy if you need us so feel free to let us know about any issues or questions troubling along the way.

  • Profile Image
    Answered on July 10, 2015 at 11:55 AM

    Hi,   I really did try and understand the instructions, but I have failed.  I added the Form calculation, under the matrix, on my form.  I see how I can choose my text fields in my matrix.  Now what?  How do I create a validation rule?  Thanks so much for your patience with me, I appreciate your help!  Cathy

  • Profile Image
    Answered on July 10, 2015 at 02:20 PM

    I understand that you want to restrict the users to enter only the value mentioned in the header for each field on a matrix. Please correct me if I am mistaken. It seems that it is not possible to validate the numbers/values on a matrix field. However, your requirement can be achieved by using the direct number field. This field has got an inbuilt validation to set minimum and maximum values. Also, you can perform calculations using these fields.

    Let us know if that works for you.

  • Profile Image
    Answered on November 16, 2015 at 03:40 PM

    Yes!! It works this way!!! Thank you!

  • Profile Image
    Answered on November 16, 2015 at 05:01 PM

    In my colleague's name you are welcome.

    For anyone else that finds this thread I would recommend taking a look at the following guide as well: How to perform form calculation using the "Matrix Field"