Skip navigation
Currently Being Moderated

Making rawValue text data appear as Upper Case, Sentence case etc

Jan 22, 2010 8:18 PM

This is hopefully a simple one.... but i have not figured it out after a few hours so any help would be great

 

i want to take rawValues from text fields and use them in various places

 

so imagine

 

FirstName.rawvalue = "steve" and Surname.rawValue = "Brown"

 

I want to be able to use FirstName and Surname with other text as either forced Caps or forced sentence case or whatever

 

A working example being,

 

"This book is owned by " + Firstname.rawValue (++somehow caps++) + Surname.rawValue (++somehow caps++) +" please return if found"

 

to produce

 

This book is owned by STEVE BROWN please return if found      

 

But also to be able to use those values to produce "Steve Brown" elsewhere

 

is there some way to apply uppercase/sentence case/lower case to a value like this by JAVAscript?  

 

thanks

 
Replies
  • Currently Being Moderated
    Jan 23, 2010 6:45 AM   in reply to legallogic-DqvA6p

    By using .toUpperCase() method in javascript we can get strings in required formats.

    *****.toUpperCase(); // gives whole string in Upper Case

    *****..substr(0,1).toUpperCase()+""+*****..substr(1);//gives first character to upper case then add rest of the string.

     

    Please find the attached sample.

     

    RAGHU.

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 23, 2010 4:04 PM   in reply to legallogic-DqvA6p

    In sample i just place to one text field.

    In ur case make those as functions, where ever need just call that functions so it will return the required format.

    Check the attached sample. These functions under script variables named as js. Also first text field exit event i am calling those functions.

     

    RAGHU.

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 23, 2010 5:07 PM   in reply to legallogic-DqvA6p

    No attachement in ur previous post.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 23, 2010 5:41 PM   in reply to legallogic-DqvA6p

    In ur file script object and code for js is missing. please check the attached updated file.

     

     

    RAGHU.

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Jan 23, 2010 5:54 PM   in reply to legallogic-DqvA6p

    That is the way to create script variable which can be access any where in the pdf.

    But here we are creating script object.

    right click on variables on hirachy tab then click on insert script object and re-name the script object to js. copy the code to top window when selected the new created object, it will solve ur problem.

    Attachments:
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 24, 2011 2:35 AM   in reply to Raghu Nagireddy

    Useful script.

     

    I was wondering if it is posible to extend the script to set each first character of a word to upper case and the rest to lower case, if there are several words in the field

     

    i.e. ”james brown” will be set to ”James Brown”

    and “JAMES BROWN” wil be set to”James Brown”

     

    I tried this:

    uC.substr(0,1).toUpperCase()+""+uC.substr(1).toLowerCase();

     

    But this only sets the first character to upper case and the rest of the field to lower case. How do I acces the next word?

     

     

    Kirstine

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points