www.webdeveloper.com
Results 1 to 4 of 4

Thread: Changing account name format

  1. #1
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    112

    Changing account name format

    the following is the code for the the account_name field. it requires something like FirstName MI Lastname.

    Code:
    // 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...

  2. #2
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    I'm not entirely certain as to what you want, but perhaps you're looking for this:

    PHP Code:
    if(eregi("^[a-zA-z]{2,}$}"$f[name])){ 
    [J]ona

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    112
    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??
    Code:
    } else {
        if($comma) $q.= ' , ';
            $q.=" account_name = '$f[name]' ";
            $comma = TRUE;
    }
    thanks

  4. #4
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Actually, to save you time, I'd put this before any of the code you originally posted:

    PHP Code:
    $f_required[name] = FALSE
    [J]ona

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles