Skip to main content
Known Participant
September 16, 2010
Question

Auto-capitalize form input

  • September 16, 2010
  • 1 reply
  • 1081 views

Hi all,

I've been seeing forms popping up here and there that auto-capitalize a user's input.  What I'm trying to get my form to do is capitalize each new word in a form field.  For example, instead of Firstname lastname, I'm going for Firstname Lastname.  I tried the css command text-transform: capitalize, which does the trick, but only on screen.  The capitalized values don't carry over; it's just an on-screen mask.  I also have autocapitalize="on" in each of my text input fields.

Thanks for any help/suggestions!

    This topic has been closed for replies.

    1 reply

    Inspiring
    September 16, 2010

    I would use CSS or Javascript for display in the client's browser then use a user defined function to handle captializing the input when it is handled on the server ( I assume you want to handle capitalization before inserting text into a database ). 

    Try cflib.org for a CF function:

    http://www.cflib.org/udf/CapFirst