Concatenating 2 text fields and validating characters - InfoPath Dev
in

InfoPath Dev

Concatenating 2 text fields and validating characters

Last post 10-18-2012 12:40 PM by Anson Hidajat. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-17-2012 06:33 AM

    Concatenating 2 text fields and validating characters

    Hi,

    I have been working with infopath for a little while but do not have advanced knowledge of validation.  Hopefully someone can help me out here.

    Part 1: I have a requirement where I need to concatenate 2 fields (both text, firstname and lastname)  I need to validate the sum of these two fields and verify that the sum is not greater than 20 characters.  If they are less than 20 characters, then the form can be submitted.  If they are 20 or more, then there should be an error to the user.  

    Part 2:  It would be nice to also validate to restrict special characters and spaces in both of these fields.

    Does anyone have any ideas on this?

  • 10-18-2012 12:40 PM In reply to

    Re: Concatenating 2 text fields and validating characters

    1) Create a validation rule that goes something like if string-length(concat(firstName, " ", lastName)) > 20 then display error "Cannot be more than 20 characters"

    2) Similarly you can also create a rule that checks for individual special characters, but this would be a little more hard coding.  Perhaps an easier way is just to check the existence of only letters both upper and lower case.

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

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