Announcement Announcement Module
Collapse
No announcement yet.
php email form - min. characters required? Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Latest Topics Latest Topics Module
Collapse

  • DonPig
    Reply to How to cross over from that amateurish look to refined professional graphic design
    DonPig
    Hello Xrooc,

    In my opinion practice makes perfect, the only way to get better is by doing and analyzing where did you go wrong (or maybe not as good as you intended to) and try to make it...
    Today, 05:37 AM
  • DonPig
    Reply to Feedback on my CD cover please!
    DonPig
    Hello Xhabiba

    I agree with Aniroc, the design of the cover is nice and clean, but in my opinion it doesn't really relate to the product (salsa music) at first sight; seeing this cover i would...
    Today, 05:28 AM
  • DonPig
    Reply to Portfolio critique requested :)
    DonPig
    Thank you B !

    I will try to think of a better way to integrate and draw more attention to the language button. For the interface I tried to make a simple menu that was functional for desktop...
    Today, 05:16 AM
  • herry james
    Reply to Just start posting.
    herry james
    KitchWitch!I am thankful to you to inform me and guide me properly. I hope soon my comments will be shown quickly without moderation.
    PanToshi! I am happy to see your quick response. Herry is my...
    Today, 04:29 AM
  • B
    Reply to Hello from the East Coast (US)
    B
    Welcome aboard Aniroc192! If you've looked around, you've likely already stumbled across the welcome messages to other new forum members, but they're inescapable, so here goes...

    Here are...
    Today, 12:52 AM

X
Conversation Detail Module
Collapse
  • 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, 11: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

                Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2015 Mediabistro Inc.
                Working...
                X