sorry it should have been
var f= getField(drop1);
// Create a variable to contain the array
// using the whitespaces as a criteria for splitting the string
LASTNAME= f.split(" ");
for(i = 0; i < lastname.length; i++>)
As the drop-down field's custom validation script, using this code (adjust the field names to match yours):
var name = event.value; var words = name.split(" "); this.getField("FirstName").value = words.shift(); this.getField("LastName").value = words.join(" ");
Of course, this is not a very accurate way of doing it as some people have a first name that is more than one word, and is not necessarily hyphenated, like "John Paul Smith", and this script only considers the first word in the name to be the first name...
Another approach would be to use the "Value" option to hold the first and last name with a special separator not in a name. This would then let one deal with multiple first or last names.