Log in

View Full Version : Transform input type=password into lowercase



forum_amnesiac
04-17-2009, 09:54 AM
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.


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


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


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

bluewalrus
04-17-2009, 04:18 PM
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...

Nile
04-17-2009, 04:42 PM
Use:


string.toLowerCase()

The highlighted is the function you should use, and the red is what you should replace with the value of the string.

forum_amnesiac
04-17-2009, 05:49 PM
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.

Nile
04-17-2009, 07:54 PM
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.