Hi all.
I have a form with a textbox for the full name and I whant to uppercase the fist letter in the first and last name.
I have a function for that and all works well, the problem comes when there is a hypen "-" in the name. I have the split part working but on the join side I cant get it to work.
function ucFirstAllWords( str )
{
var pieces = str.split(" "); //use this for space and "-" split (/[ \/-]/);
for ( var i = 0; i < pieces.length; i++ )
{
var j = pieces[i].charAt(0).toUpperCase();
pieces[i] = j + pieces[i].substr(1);
}
return pieces.join(" ");
}
If I use this code and slpit on both space and hypen all get join with space, I have tyed to make a function in function to capture the first hyphen but that didn't work
probably doing it wrong 
Does anyone have any idea how to solve it?
I'm using LC 8.0
Thanks.
//Fredrik Nordstrand, Sweden