Force Text Field to Upper and Lower Case



I have read a lot of post regarding forcing text in a text field to upper case and the first letter in the field to upper case and the rest to lower case. I have been able to get these to work:-

All uppercase........ if (event.change.length > 0) {event.change = event.change.toUpperCase() }

First Letter upper then the rest of text to lower........... event.value = event.value.substring(0,1).toUpperCase() + event.value.substring(1).toLowerCase();

I would like a simple script that would change all words entered, to be first letter of each word to Upper case and the rest of the word Lower case, eg michael david or MICHAEL DAVID to Michael David

Any help would be greatly apprecaited

Accepted Solutions (0)

Answers (0)