Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Character Field

    I have a form and I want to make sure that the zipcode box has 5 characters in
    it and if doesnt it props the user to reenter their zipcode. Can I check the
    number of characters in the form field box.?? like character_length? Does
    anyone have any ideas? Thanks.

    <CFFORM name="countysearch" action="index.cfm?begin_key=1" method="post">
    <table width="100%" border="0">
    <tr>
    <td width="48%" class="style8">Select your County</td>
    <td width="52%" class="style8">Or Seach by Zipcode:</td>
    </tr>
    <tr>
    <td><select name="county">
    <option value=" " selected="selected"></option>
    <cfoutput query="getcounty">
    <option value="#county#">#county#</option>
    </cfoutput>
    </select></td>
    <td><cfinput type="Text" name="zipcode" required="No" size="10"
    maxlength="5" validate="zipcode"></td>
    </tr>
    </table>
    </CFFORM>

    TheScarecrow Guest

  2. Similar Questions and Discussions

    1. Extract Character By Character in PDF
      Hi I have requirement to read the content of the PDF file. I achieved it using Adobe SDK and VB.NET. I used the GetJsObject, getPageNthWord and...
    2. Can't get ? character loaded in dynamic text field
      I need the use of the chars ? and ® but only the latter appears. I'm using a loadVars object and an external .txt file which is loading with...
    3. InDesign ME Character Problem! Character-Change by Printing or saving *.PS!
      Hi everybody! I have some problems with ME Version. When i want to print a page with FARSI-Text in it, he changes one character! on screen he...
    4. Problem with character palette and Tracking field: can't type zero after type is modified
      System: Illustrator CS, Panther 10.3.3 Try this: Create a few characters of type. Select some letters and change their tracking (Option + Command...
    5. CDO character limitation in Body field ?
      Oops - actually the limit for the Body field is 1866 characters. Pete
  3. #2

    Default Re: Character Field

    Hi Scarecrow

    You could change the validate parameter to use validate="regular_expression"
    and then have a Regular Expression that will check that the zip code is either
    empty or has 5 characters.

    <cfinput type="Text" name="zipcode" size="10" maxlength="5"
    VALIDATE="REGULAR_EXPRESSION" PATTERN="">

    HTH

    Zoe

    zoeski80 Guest

Posting Permissions

  • You may not post new threads
  • You may 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