I'm using this code:
function ucfirst(field) {
field.value = field.value.substr(0, 1).toUpperCase() + field.value.substr(1);
}
this is working if i have a city like california
==> California
. But if I have new york
it will not convert the first letter.
Any tips how to make this code work?