Upper case all data - InfoPath Dev
in

InfoPath Dev

Upper case all data

Last post 10-06-2011 07:13 AM by cmoses0971. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-08-2005 01:14 PM

    Upper case all data

    Is there a way to upper case all the input in a form, instead of having to apply the translate function to every field in the form.
  • 08-08-2005 01:36 PM In reply to

    Hi jeanpaul,
    Directly in InfoPath there is no such method, but as you said you can use translate. Other way is write a funtion to convert data to uppercase by using string.ToUpper() function.

    Agni
    InfoPath Dev India
  • 08-08-2005 02:00 PM In reply to

    I am not sure where and how to implement the string.ToUpper() function...ar you suggesting to aplly to every node or there a way to apply to all nodes...sample code would help...thanks
  • 04-24-2006 12:11 PM In reply to

    I would like to do this as well as the following:

    1) Convert a state field to all upper
    2) Initial cap the first letter of a field
    3) Format a telephone number field as: (999) 999-9999

    The string.ToUpper() function is something that has to be done through code? Where do I find help on these functions?

    Thanks!
  • 04-24-2006 06:46 PM In reply to

    Try doing something like this in the OnAfterChange of each of the nodes:

    eventObj.site.text = eventObj.site.text.ToUpper();

    This would make the text all uppercase, but for number 2 you would do this:

    var text = eventObj.site.text;
    text = text.substring(0,1).ToUpper() + text.substring(1, text.length);

    eventObj.site.text = text;

    Using these similar techniques you can create option 3. I hope this helps!

    REF:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/9cf9a005-cbe3-42fd-828b-57a39f54224c.asp
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/9cf9a005-cbe3-42fd-828b-57a39f54224c.asp
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-25-2006 11:42 AM In reply to

    Oh, boy. Thanks, Matt. You guys are way over my head! I'm assuming that's all through code??? If so, what language is that?

    I did come up with a solution for each of the three as follows:

    1) Convert all to uppercase:
    translate(., "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")

    2) Convert first letter to uppercase:
    concat(substring(translate(., "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 1), substring(., 2, string-length(.) - 1))

    3) Format a telephone number as 999 999-9999:
    I adapted S.Y.M Wong A Ton's solution for formatting a time field found here: http://enterprise-solutions.swits.net/infopath/auto-format-time-on-lostfocus.htm.
    He was so taken with the idea of using it for telephone numbers that he's re-thinking the solution and will post it as a new receipe this weekend.

    I will also save what you've posted as an example of doing it with code, correct? ;-)
  • 04-25-2006 11:44 AM In reply to

    Matt:

    I just followed your links and see it's JScript. How do you attach that to the field?

    Deb
  • 10-06-2011 07:13 AM In reply to

    That worked great CycleFitness... That was all I needed as well. :) Works great!

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