Looking for a simple way to convert a string to title case

New to LiveCycle and Javascript.  Looking for a simple way to convert a string to title case, except acronyms.  Currently using the the following, it converts acronyms to lower case:
var str  =  this.rawValue;
var upCase = str.split(" ");
for(i=0; i < upCase.length; i++) {
upCase[i] = upCase[i].substr(0,1).toUpperCase() + upCase[i].substr(1).toLowerCase();
this.rawValue = upCase.join(' ');

Thanks for the reply.
Found the following script in a forum, which works fine as a "custom validation script" in the.pdf version of my form.  However, it will not work in LiveCycle?  The problem seems to be with
"return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g"
function toTitleCase(str) {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
    return str.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title){
if (index > 0 && index + match.length !== title.length &&
  match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
(title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
title.charAt(index - 1).search(/[^\s-]/) < 0) {
return match.toLowerCase();
if (match.substr(1).search(/[A-Z]|\../) > -1) {
  return match;
  return match.charAt(0).toUpperCase() + match.substr(1);
event.value = toTitleCase(event.value);

Similar Messages

  • Looking for a simple way to use the back button

    I've read a couple articles on getting the browsers back
    button, call me slow but I don't quite understand them. Is there
    some way to execute a history.go(-1) type function in Flex? If I
    can provide my own back button I'd forgo the browsers back button .
    Any thoughts?

    Flex has a history manager (Flex 2) and deep linking feature
    (Flex 3).
    For more information see
    http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Deep_Linking
    and
    http://livedocs.adobe.com/flex/3/html/deep_linking_1.html
    Peter

  • Accent marks in Pages. I'm looking for a simple way to employ  accent marks when writing in another language WITHOUT using a different keyboard.

    In Microsoft Word for PC, all one needs to do is hold the CTL key down, press the accent key needed, such as ` or ~ or ' for example, then press the letter key over which the accent should go.  Does Pages and Apple Mail not have such an easy way to do it?  Thanks to anyone who has a better way.

    Type the dead letter and the vowel:
    eg umlat is option u then the vowel = äëïöü
    option i then the vowel = âêîôû
    option e then the vowel i = áéíóú
    option ` (above the tab key) then the vowel = àèìòù
    option n then the letter = ñãõ
    They are characters usually associated with the accent and have been standard on the Mac for decades.
    Peter

  • [solved] Looking for a simple YouTube video converter

    Hello,
    I am not a video expert and all my video editing is limited to converting my videos to a YouTube optimised format before uploading onto the platform.
    At the moment I am using transcoder. However, I would prefer an other more minimal program which comes with predefined export profiles for optimal quality for YouTube.
    Does anyone of you use a very minimal and leightweight converter which is sufficient for YouTube videos?
    Regards
    Last edited by orschiro (2012-11-28 21:40:13)

    drcouzelis wrote:You only need to learn the optimal YouTube configuration for the crazy ffmpeg command line options once, and then you can just use that to convert your videos.
    Since YouTube will re-encode anything you upload the best practice is to upload the original content. This isn't always practical of course, so you can re-encode it for a more manageable file size, but still high enough quality that it won't needlessly suffer when YouTube takes a dump on it. Here's an example that will work with ffmpeg from the repository,  ffmpeg-1:1.0-2:
    ffmpeg -i input -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -c:a copy output.mkv
    The two options of interest are -crf and -preset. The basic methodology when using crf is to use the highest value that still gives you an acceptable quality and the slowest preset you have patience for. See  FFmpeg and x264 Encoding Guide for more information. This example will also simply copy the audio from the input to the output. If you want to re-encode the audio, such as if your input audio is uncompressed, replace "-c:a copy" with "-c:a libmp3lame -q:a 3" or "-c:a libvorbis -q:a 6" for a high-quality output.
    skanky wrote:A search for ffmpeg and youtube brings up a few things that might do the job,
    This might be do the job? - http://shahidhussain.com/optimize-video … th-ffmpeg/
    That is a terribly outdated example: it resizes the video to 320x240, changes the frame rate, and uses 800 bits/s for a video bitrate. That's bits, not kilobits!

  • Novice designer looking for a simple way to design a question/ answer guide?

    I have Adobe CS3 and need to put together a question / answer generator.
    Looking to write something similar to the Microsoft Help Center but more functionality picts ,diagrams and possibly videos.
    most likely will host the project on a sever and then place link to QA site on clients WS.
    Any templates available out there (flash , Dreamweaver) that could speed the process up and at least get me pointed in the right direction?
    THX

    Oh crap, I just answered my own question by reading the manual ("when all else fails, read the manual"). I need to create a zip file of the project, then post it on my ftp. What a bother.

  • I'm looking for a simple DJ app

    Hi Folks,
    I hope this is the best place for this question!  I'm looking for a simple App that will allow me to add music on the fly to a playing playlist. iTunes DJ does most of what I want but doesn't allow me to drag and drop order or remove songs.  I don't need turntables or eq or anything like that.  Just a simple way to create playlists on the fly with the ability ro rearange the order, add and remove songs on the fly. Also, if there's a better forum for my question, please advise.
    Thanks!
    Greg

    Which particular Mac OS are you running, psychmac?

  • Looking for a simple answer ........ without the ...

    looking for a simple answer  ........why is it more difficult for skype to connect than before . It fails to ring most times and your never sure if it is just slow or did not dial in the first place???  and is there any way to disable the leave a message feature ??? I am afraid soon it will be like most wondows applications where you will need endless updates and patches just to keep it running ..... Why is it that everyone is trying to fix everthing when it isnt broken.

    WTF? I'm sure you can find plenty of examples on google. It's on you to take the time to go through them, study them, and, if you still don't understand something, post a clear, concrete question that indicates what you read and what you didn't understand about it.
    As is, you're essentially treating folks here as your research flunkies and saying, "Give me an example that's better than all the ones already easily available to me. Read my mind to know why I didn't like them."

  • Looking for an app that will convert written chemical formulas to text. Any suggestions?

    Looking for an app that will convert written chemical formulas to text. Any suggestions?

    I could not find any app that would do this. There are different types of message apps but nothing that I could find to do what I am looking for. For a specific contact I would like the message to have a notification that will not go away until I acknowledge it. Just like you would do if it was a pager.

  • Looking for a simple drawing application for my grand-daughters

    Well, that's more or less it, I'm looking for a simple drawing application for my grand-daughters. In the children section of iTunes store, there's only a few books and nothing more. I bought the iPad mainly for my grand-children to teach them a bit and I don't find interesting things for them.
    Can anybody help me with that?
    Pedro Godfroid Goffin

    Brushes is a nice finger drawing app. Since you didn't say how old they are, I don't know if the interface is to difficult for them to use.
    Sketchbook is another nice drawing app.
    Neither are free.
    Glor

  • Looking for a simple flip book template for Flash CS5

    Hi, I'm looking for a simple flip book template for Flash CS5 for a 20 page brochure/ booklet. Or a tutorial. Does anyone know of one?
    Thanks!

    Hi Mark,
    No need to restrict your choice to the preset Pages Templates. Do a web search and choose a Word template. Pages will open Word documents and templates. Or design your own:
    This is a Table I inserted into a blank Pages Word Processing document. Format the date column in Inspector > Table > Format > Cell Format. Select the first Date cell,then drag the fill handle down to increment the dates.
    Regards,
    Ian.

  • Looking for a simple tutorial to building my first responsive web site in Dreamweaver CC.

    I am looking for a simple tutorial to building my first responsive web site in Dreamweaver CC.
    I have watched the tv.adobe video 3 times and I cam not able to do the actions the author shows.
    help.
    Ken Edwards

    Responsive and simple don't go hand-in-hand.  First do some prep-work to understand the concepts.
    Responsive Web Design
    http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/
    Introduction to CSS Media Queries
    http://www.adobe.com/devnet/dreamweaver/articles/introducing-media-queries.html
    Jump start your RWD projects with any of the Responsive Frameworks below:
    Foundation Zurb
    http://foundation.zurb.com/templates.php
    Skeleton Boilerplate
    http://www.getskeleton.com/
    Initializr (HTML5 Boilerplate, Responsive or Bootstrap)
    http://www.initializr.com/
    DMX Zone's Bootstrap FREE extension for DW
    http://www.dmxzone.com/go/21759/dmxzone-bootstrap/
    Project Seven's Page Packs (Commercial CSS Templates)
    http://www.projectseven.com/products/templates/index.htm
    Have fun!!
    Nancy O.

  • Looking for a simple voice to text app

    I am looking for a simple app that will recognize my contacts and create voice to text messages. What is the best? Thanks for your help!

    Thanks, this app is simple and it works well. It has good voice recognition.

  • I am looking for a simple app to enable me to crop a face from one pic to another(fun). is it possible to do this via iPhoto or aperture?

    i am looking for a simple app to enable me to crop a face from one pic to another(fun). is it possible to do this via iPhoto or aperture?

    No, you will need something more advanced, like Photoshop.

  • I am looking for an simple app to do invoices. I only need to send around 6 invoices per week and they are usually paid by cheque. I need to be able to tick these as paid and keep a list of unpaid invoices so I can send reminders. Any suggestions please?

    I am looking for an simple app to do invoices. I only need to send around 6 invoices per week and they are usually paid by cheque. I need to be able to tick these as paid and keep a list of unpaid invoices so I can send reminders. Any suggestions please?

    I am looking for an simple app to do invoices. I only need to send around 6 invoices per week and they are usually paid by cheque. I need to be able to tick these as paid and keep a list of unpaid invoices so I can send reminders. Any suggestions please?

  • My cd drive on my mac w/ itunes is busted, so i'm looking for an alternative way to get mp3 files (large, for an audiobook) from a cd to my iphone. Any suggestions? Thanks

    My cd drive on my mac w/ itunes is busted, so i'm looking for an alternative way to get mp3 files (large, for an audiobook) from a cd to my iphone. Any suggestions? Thanks

    Copy them to a thumb drive using a different computer then use that to transfer them to your machine. Over a network from a machine with a working CD drive...
    What does this have to do with using the iPhone in an enterprise environment?

Maybe you are looking for

  • Error with Pivot Table in 10.3.6 weblogic server

    Hi Everyone, I created an ADF application and in that i have a Pivot Table i developed using Jdeveloper 11.1.1.3 it was working fine when we deployed the application in Weblogic server 10.3.3. Now DBA's upgraded the Weblogic server to 10.3.6 so i dow

  • My contacts do not sync from my iphone over iCloud to my mac.

    Sorry if this a repeat but I've searched and can not find an answer.  I have an iphone and a mac book pro both os5 with the cloud set up to sync everything.  When I snap a picture with my iphone it shows up on my mac no problem.  However, when I add

  • Problem to reset my ID

    hello i have an iphone 4s and im trying to reset my password but when im pressing the reset and it says "email has been sent" i dont receive nothing on my email? please help me i cant use my iphone.

  • Why it is not possible to open raw files

    I have tranferred som NEF RAW files to an external harddisk, and now I can't open them i Elements9. Anyone know why?

  • Route Determination and allowed substitutions

    Can anyone please help with the following issue. I need to make changes in config so that a customer can receive a delivery on a different route than originally on the delivery. i.e. customer x has an order with route a. The LSP shippes the order but