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

Java Script in form

Avatar

05-08-2008

How to embed a JAvascript in a form?

Replies

Avatar

05-08-2008

Hi



I have this following JavaScript I need to embed it into my form.the script is to capitalize the first letter in the name and address fields.

How do i embed it into a form



The Script



function toUpper(obj) {

var mystring = obj.value.toLowerCase();



var sp = mystring.split(' ');

var wl=0;

var f ,r;

var word = new Array();

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

f = sp[i].substring(0,1).toUpperCase();

r = sp[i].substring(1);

word[i] = f+r;

}

newstring = word.join(' ');

obj.value = newstring;

return true;

}



Call the above function for any text item .... onkeyup='toUpper(this)'

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

05-08-2008

Use the Adobe Form Designer and add the script of the appropriate location in the form.



Jasmin