Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Help with the script for fullname

Avatar

14-07-2008

Hello



I am trying to write a script on my form for a fullname field. For eg:" someone enters fullname as abc l xyz then i want it to be like Abc L Xyz

i tried writing a script but i am messing up somewhere. Can anyone help me please, its urgent



Thanks

Replies

Avatar

16-07-2008

Hello i have a script which get the first letter of a word in caps but i want it for the fullname can anyone help.following is the script for one word



LastName = Concat(Left(upper(LastName),1),lower(Right(LastName,Len(LastName)-1)))

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

16-07-2008

Have you tried the following function in the xPath builder:



upper-case: "Each lowercase letter is converted to its uppercase equivalent, if it has one."



Something like upper-case(/process_data/@LastName) might do it.



Jasmin

Avatar

16-07-2008

Hi Jasmin



I am trying to put a jAVAScript into the script window and got the following script it works otherwise but when inserted into form it doesn't work

I am doing it on exit event



var FormName = "7158.pdf";

var FieldName = "FullName2";



function CapitalizeNames() {

var ValueString = new String();

eval('ValueString=document.'+FormName+'.'+FieldName+'.value');

ValueString = ValueString.replace(/ +/g,' ');

var names = ValueString.split(' ');

for(var i = 0; i < names.length; i++) {

if(names[i].length > 1) {

names[i] = names[i].toLowerCase();

letters = names[i].split('');

letters[0] = letters[0].toUpperCase();

names[i] = letters.join('');

} else { names[i] = names[i].toUpperCase(); }

}

ValueString = names.join(' ');

eval('document.'+FormName+'.'+FieldName+'.value=ValueString');

return true;

}

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct Reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

17-07-2008

In the script window it uses BeanShell which is very close to Java.



In the form you can only use JavaScript.



Jasmin

Avatar

18-07-2008

For information about beanshell, go to http://www.beanshell.org.



For information about the LiveCycle objects and methods that are available in the script, see http://www.adobe.com/go/kb402587



Scott