Forum Moderators: phranque

Message Too Old, No Replies

RE: Uppercase only in form text box

         

walker

4:23 pm on Jan 25, 2005 (gmt 0)

10+ Year Member



Hi

I need to make a form textbox - UPPERCASE ONLY - anyone know how to achieve this?

I know how to midify appearance via style

<input type="text" name="T1" size="20" style="text-transform: capitalize">

but don't now how to properly validate so as the form results appear capital.

Any help really appreciated!

Kind Regards

Walker

txbakers

4:48 pm on Jan 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can write a javascript which gets called from the form tag : onSubmit="return verify()"

which will check the contents of the text box to make sure it's all caps.

function verify() {

document.form.textBox.value = document.form.textBox.value.toUpperCase();
return true;

}

walker

5:07 pm on Jan 25, 2005 (gmt 0)

10+ Year Member



Hi

Thanks, I know how to do that but I want it to force capitals rather than validate onsubmit.

walker

5:16 pm on Jan 25, 2005 (gmt 0)

10+ Year Member



Sorry miss-understood - that should work fine!

THANK YOU!

Kind Regards

Walker