Pages

Saturday, 6 July 2013

Capitalize first letter in infopath

Use the below formulae and paste into your field's default value:

concat(translate(substring(field1, 1, 1), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), translate(substring(field1, 2, string-length(field1)), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"))

Well this was only for first word, we mostly need  for up to second word like for First name and for Last name..

For up to two words...:

use the below.

We need four fields

Field1
Input the value

Field2
concat(translate(substring(substring-before(field1, " "), 1, 1), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), translate(substring(substring-before(field1, " "), 2, string-length(substring-before(field1, " "))), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"))

Field3
concat(translate(substring(substring-after(field1, " "), 1, 1), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), translate(substring(substring-after(field1, " "), 2, string-length(substring-after(field1, " "))), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"))

Field4
concat(field4, " ", field2)

No comments:

Post a Comment