G
gil
I have a script that will capitalize the first letter of every word in
my descriptions. But some of my descriptions contain ( ) and /. For
example bezel (black). I need the script to capitalize Bezel and
(Black), but it is only finding the bezel and leaving the (black) in
lower case. Here is the script below. Any help would be greatly
appreciated.
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function capitalizeMe(obj) {
val = obj.value;
newVal = '';
val = val.split(' ');
for(var c=0; c < val.length; c++) {
newVal += val[c].substring(0,1).toUpperCase() +
val[c].substring(1,val[c].length) + ' ';
}
obj.value = newVal;
}
// -->
</SCRIPT>
my descriptions. But some of my descriptions contain ( ) and /. For
example bezel (black). I need the script to capitalize Bezel and
(Black), but it is only finding the bezel and leaving the (black) in
lower case. Here is the script below. Any help would be greatly
appreciated.
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
function capitalizeMe(obj) {
val = obj.value;
newVal = '';
val = val.split(' ');
for(var c=0; c < val.length; c++) {
newVal += val[c].substring(0,1).toUpperCase() +
val[c].substring(1,val[c].length) + ' ';
}
obj.value = newVal;
}
// -->
</SCRIPT>