The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Text Transform for Form Input, I want to force UPPERCASE when form data is sent
Liz
post Oct 27 2006, 11:12 AM
Post #1





Group: Members
Posts: 1
Joined: 27-October 06
Member No.: 592



I have had a good look for the answer to this question and can't find it.

Is it possible to to force text to be uppercase when data is sent from a form?

If it is possible, is this achieved by using { text-transform: uppercase }?

Best wishes,

Liz
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
JamieHarrop
post Oct 27 2006, 11:49 AM
Post #2


Advanced Member
****

Group: WDG Moderators
Posts: 129
Joined: 25-October 06
From: West Yorkshire, UK
Member No.: 570



Liz, would you like the text to appear as uppercase when a user is typing in a form, or would you like the text to appear as uppercase when you read the submitted results of a form?

If the former, then yes, text-transform will work.

If you would like text to appear in uppercase in input elements, use:

CODE
input {
text-transform: uppercase;
}


You may want to read this tutorial: http://www.sitepoint.com/article/style-web-forms-css
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 27 2006, 11:51 AM
Post #3


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



If you want to make sure the user's form data is sent to the server in uppercase you need to use form validation: http://htmlhelp.com/faq/html/forms.html#required-fields
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
adoptmuttsmeows
post Aug 7 2009, 06:49 PM
Post #4





Group: Members
Posts: 1
Joined: 7-August 09
Member No.: 9,359



Found a perfect answer thanks to this post http://www.dreamincode.net/forums/showtopic11411.htm

<input type="text" onBlur="this.value=this.value.toUpperCase()"/>

I'm posting it here as this was where google search first brought me when I was trying to find out how to turn my form text input into ALL caps both as people typed it and as it was submitted. I ended up using this in combination with

style='text-transform: uppercase;'

So the resulting code I'm using is:
<INPUT type="text" style='text-transform: uppercase;' onBlur="this.value=this.value.toUpperCase()">
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 09:51 AM