Announcement

Collapse
No announcement yet.

php email form - min. characters required?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • php email form - min. characters required?

    I am using the well-known sendit.php file to email an online form. My goal is to obtain a person's full name. This form is used by existing clients and I would like to prevent them from entering initials in the name fields. I am aware nothing can prevent a client from typing random characters but thought setting a minimum of characters would persuade them to fill it out accurately.

    I have already set the first and last name fields as "required." Now I want to ensure that more than 3 characters are entered by the viewer. Any tips on how to do this?

    Thanks in advance!

  • #2
    I am not sure how to do this... but not sure you would want to.
    I actually know people whose legal name is only two letters... might be frustrating for them if they can't enter their name...
    I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

    Comment


    • #3
      I've never heard of sendit.php, but you know how to work with PHP you can use the strlen() function to check the length of a given string:

      PHP Code:
      $fname strlen($_POST['fname']);

      if (
      $fname 4)
      {
         
      //Code telling PHP what to do if the first name is less than 4 characters...

      I agree with Audentia that someone named Al or Sue would probably be very frustrated at not being able to enter their name (I have a friend whose legal name is Kim).

      Digi
      The world is divided into people who think they are right.
      —Anonymous

      Comment


      • #4
        empty() is a more user friendly option. I wouldn't recommend a minimum length because as others have said it is possible to have a 2 or 3 character name. I don't think it would be bad though to check for more then 1 using strlen().
        Last edited by tZ; 08-21-2009, 06:20 PM.

        Comment


        • #5
          Yeah, don't be hatin on all the Bos and Eds
          “Pain is temporary. Quitting lasts forever.” Lance Armstrong

          Comment


          • #6
            I work with someone whose last name is Ng. He'd be unable to fill out your form properly.
            ___________
            Burn the land and boil the sea, you can't take the sky from me.

            blog/portfolio

            Comment


            • #7
              Lots of people wouldn't be able to use it.

              Tom, Tim, Jim, Pam, Kim, Joe, Jak, Wu, Mat.
              Professional Pixel Pusher — Designing the world around you. | Working daily to reach 10,000 hours of practice.

              Comment


              • #8
                LOL! Thanks guys. I appreciate your feedback very much.

                Comment

                Search

                Collapse

                Sponsor

                Collapse

                Incredible Stock

                Latest Topics

                Collapse

                • PrintDriver
                  Reply to Seeking feedback: 2D & 3D concepts
                  PrintDriver
                  If your logo is what you have shown in the subway poster, the reason I ask how your logo is illuminated is because those skinny letter strokes and serifs at the size you have indicated on your wall (in...
                  Today, 08:40 AM
                • calebninja
                  Reply to just went from having the oldest imac in the company...
                  calebninja
                  Hey I'm in Kansas City too! What do you think about the Chiefs taking a Maholmes last night in the draft? Pretty crazy that it's been so long since they've drafted a first round QB, but I love the mo...
                  Today, 08:37 AM
                • KitchWitch
                  Reply to Logo Advice
                  KitchWitch
                  Hi Billz and welcome to GDF.

                  We ask all new members to read very important links here and here. These explain the rules, how the forum runs and a few inside jokes. No, you haven't done anything...
                  Today, 07:28 AM
                • mortician.19
                  Reply to Seeking feedback: 2D & 3D concepts
                  mortician.19
                  Thanks for the feedback for my assessment, I was a bit vague with the brief (the elements are to market the studio not decorate the studio) - your comments on the wall sign were very helpful, it's the...
                  Today, 06:00 AM
                • PrintDriver
                  Comment on Copyright issue?
                  PrintDriver
                  Don't ever assume you are too small an entity to be noticed by copyright holders. I do a lot of image work. More than once I've had image owners tell me they are in the process of doing reverse searches...
                  Today, 05:53 AM
                GDF A division of Mediabistro Holdings Adweek | Mediabistro | Clio | Film Expo Group Contact Us | Terms of Use | Privacy Policy Copyright © 2016 Mediabistro Holdings
                Working...
                X