Forum Moderators: open
The InstrRev function will find the last space in the full name and then you can then use Left() and mid() to get the 2 parts of the name - taking care in case there isn't a space in the name
Esssentially it works likes this:
(in javascript)
var fullname ="";
fullname = Request.Post("namefield");
var namesplit = String(fullname).split(" ");
var fname = namesplit[0];
var lname = namesplit[1];
This finds the blank space in the string, splits the string into an array and assigns the first part to fname, and the last part to lname.
Of course, should someone enter Fife,Barney you are in trouble.
Same with David Ogden Stiers - three names. The family name will be discarded and he will show up in your DB as David Ogden.
If you need to track two separate names, I would make them two separate input boxes in the form.