Hide a Submit Button based on the string-length of another field - InfoPath Dev
in

InfoPath Dev

Hide a Submit Button based on the string-length of another field

Last post 06-26-2015 01:08 PM by cworley. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-26-2015 12:45 PM

    Hide a Submit Button based on the string-length of another field

     Hello,

     I have a form that contains a field, Field1, that can only be 225 characters. It is a multi-line text field so I created a validation rule on it with this condition:         string-Length(.) > 225

    A dotted red box appears around the box if the user puts in more than 225 characters.

    I would like to hide the Submit Button if this Field1 contains more than 225 characters but haven't been able to do it. I created a Field2 that is a Text Field;  I changed its Control to a Calculated Value. The XPath expression formula for Field2 is:            string-length(my:Field1)

    This field calculates the number of characters used as you enter type in Field1.

     I tried to create a Formatting Rule on the Submit Button that Disables the Control based on this condition:     Field2   is greater than    225  

    However, this does not disable the Submit Button.

    Can anyone help me with this or point me in a different direction?

    thanks in advance

     

     

     

  • 06-26-2015 12:55 PM In reply to

    Re: Hide a Submit Button based on the string-length of another field

     Check the attached sample - right click the link and save the file locally, right click the XSN and select design to open in design mode. The condition I've got on the submit button is that it should hide if the string length of field 1 is > 10. You have to tab out of the field for the condition to process, tho (that's just normal old InfoPath behavior).

    Hilary Stoupa

  • 06-26-2015 01:08 PM In reply to

    Re: Hide a Submit Button based on the string-length of another field

    Hi Hilary,

    Thanks for your help. I opened your form and your rule worked just fine. Before I got your email, I tried this condition and it worked!

    Field1  is equal to   string-length(Field1) >225

     

    thank you again'

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