Results 1 to 5 of 5

Thread: Transform input type=password into lowercase

  1. #1
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default Transform input type=password into lowercase

    I have a Form in which I have this input line, it is the only input line in the form except for the submit line.

    Code:
    <td input type='password' name='wrd_pass'></td>

    I am using a CSS file in which I have the following

    Code:
    input[type="password"] {
    	text-transform:lowercase;
    	}
    In my <form> line I have an onsubmit function.

    I have put an alert in this function to display the value of 'wrd_pass'.

    When I test to see if the input has been converted to lowercase, it has not.

    Is there a problem with how I'm using text-transform in my CSS file
    Last edited by forum_amnesiac; 04-17-2009 at 09:56 AM. Reason: want email notification of response

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I don't think css can do this I think you'll need javascript. CSS styles things but doesn't alter actual inputs with regards to code....the color and font and things can be changed but the actually characters can't (if that makes sense). This is may be inaccurate but I'm sure someone will correct me...

  3. #3
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Use:
    Code:
    string.toLowerCase()
    The highlighted is the function you should use, and the red is what you should replace with the value of the string.
    Jeremy | jfein.net

  4. #4
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Thanks Nile, I ha already done it by using a function.

    I had a look at CSS1, CSS2 & CSS3 and they all say that you can use text-transform to alter text properties.

    This property can also apparently also be used to change input on HTML forms.

    I wanted to try it out because that would be a useful feature to have in my CSS file.

    I was wondering if anybody else out there had used this and could explain why I couldn't get it to work.

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Css and Javascript don't work together, CSS is just designing. It's part of the design to have lower case, but the real value is upper case.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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