Click to See Complete Forum and Search --> : Changing account name format


esm
07-02-2003, 09:08 PM
the following is the code for the the account_name field. it requires something like FirstName MI Lastname.


// NAME
if ($f_required[name]) {
// Validate this field...
if (eregi("^[a-zA-Z.,]{2,} {1,}[a-zA-Z,. ?]{1,}[a-zA-Z.]{2,}$", $f[name])) {
if($comma) $q.= ' , ';
$q.=" account_name = '$f[name]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid name!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_name = '$f[name]' ";
$comma = TRUE;
}


how do I change it so i can enter most anything???

such as Tom or Bill or Sleepyeyes...

Jona
07-04-2003, 05:59 PM
I'm not entirely certain as to what you want, but perhaps you're looking for this:


if(eregi("^[a-zA-z]{2,}$}", $f[name])){


[J]ona

esm
07-04-2003, 08:05 PM
thanks for the help...

I think the original code requires a name format of First M Last.

I just want to use a one word name. or it can be more than one word.

I just need it to stop checking the format.

do I need the following??

} else {
if($comma) $q.= ' , ';
$q.=" account_name = '$f[name]' ";
$comma = TRUE;
}


thanks

Jona
07-04-2003, 11:17 PM
Actually, to save you time, I'd put this before any of the code you originally posted:


$f_required[name] = FALSE;


[J]ona