K
knoak
Hi,
I have a page with a form, with a javascript-
file included.
I want to change the first letter of some fields
to a capital (and ot with css).
I have this function:
____________________________________________________
function doFields()
{
<!--
var str = document.SendContact.name.value;
// start in all lower case
str=str.toLowerCase()
// first Letter will always be a capital
str = str.substr(0,1).toUpperCase() + str.substr(1,str.length-1)
// capitalize each character after a space
for (i=0; i<str.length; i++) {
if (str.substr(i,1)==" ") {
str = str.substr(0,i+1) + str.substr(i+1,1).toUpperCase() +
str.substr(i+2,str.length-i)
}
}
document.SendContact.name.value = str;
//-->
};
____________________________________________________
This works fine, but there are about 10 fields that
need to be cappitalized. I don't want to write this function
10 times, but do something like
doFields(email);
Hope you understand..
Greetings knoakske
I have a page with a form, with a javascript-
file included.
I want to change the first letter of some fields
to a capital (and ot with css).
I have this function:
____________________________________________________
function doFields()
{
<!--
var str = document.SendContact.name.value;
// start in all lower case
str=str.toLowerCase()
// first Letter will always be a capital
str = str.substr(0,1).toUpperCase() + str.substr(1,str.length-1)
// capitalize each character after a space
for (i=0; i<str.length; i++) {
if (str.substr(i,1)==" ") {
str = str.substr(0,i+1) + str.substr(i+1,1).toUpperCase() +
str.substr(i+2,str.length-i)
}
}
document.SendContact.name.value = str;
//-->
};
____________________________________________________
This works fine, but there are about 10 fields that
need to be cappitalized. I don't want to write this function
10 times, but do something like
doFields(email);
Hope you understand..
Greetings knoakske