validate text field for alpha input only?

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default validate text field for alpha input only?

    How do I validate a field to make sure that the user's input was/is only
    case-insensitive alpha characters?

    I have tried playing around with pattern and mask attributes, but haven't been
    100% satisfied with my attempts. I also read somewhere (can't remember where)
    that it is better to do this type of validation in the <cfparam> tag. If that
    is true, how do I go about that?

    Here is an example of some code below:

    <cfinput name="lname" type="text" size="20" maxlength="20" required="yes"
    message="Last Name is a required field." validate="regex"
    pattern="[A-Za-z]{2,}" />

    Suggestions anyone?

    Cheers!
    James Webb

    MUSC Webmaster Guest

  2. Similar Questions and Discussions

    1. Input Text Field
      I have 4 input text fields (it1 ... it4) where I want the user to enter a code. When entered 4 digits into the first field I want the cursor to...
    2. mask disables input text field?.....
      by which he means embed the font you're using for the input textField. If you are using actionScript for this follow these steps: in library...
    3. controlling an input text field
      Ok, I've got a text field that I want the user to enter type into, I want to pre-fill it with one of 3 text options, and I want to send it to a...
    4. Can't hide Input Text field, please help
      Hello all, In one of my frames, I have Dynamic and Input Text fields. Say that I have the Title1(Dynamic) and EMail(Input) fields. If I use the...
    5. Text vs Field for text input
      I know this is a bit of a back-to-basics question, but it is something I have never really got my head around when to use text and when to use...
  3. #2

    Default Re: validate text field for alpha input only?

    Try the the CFValidator 1.1 on this page. [url]http://www.javier-julio.com/coldfusion/downloads/[/url]

    Here is the sample: [url]http://www.javier-julio.com/Test/Validator/index.cfm[/url]

    Seems pretty good.
    Jfill Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139