RegEx test and change to uppercase
Hi there,
Please can some one help me.
I've been playing around with custom keystroke scripts and all has gone ok so far apart from this variation.
I have a text field that has a RegEx test to allow only character 0-9, a-z & A-Z.
Here's the code:
var r = new RegExp("^[0-9a-zA-Z]*$");
var result = r.test(event.change);
if (result == true) {console.println("Here - stage 1 true")} else {console.println("Here - stage 1 false")};
if ( result != true )
{
event.change = "";
console.println("Here - stage 2 false");
} else {
event.change.toUpperCase();
console.println("Here - stage 2 true");
}
What I'm trying to do with this one is allow the user to enter characters 0-9, a-z & A-Z.
However, if the user enters any lowercase letter I'm trying to change it toUpperCase().
So far I've not succeeded with this
