This content has been marked as final. Show 8 replies
This is weird, i just tried your RegExp using the Adobe's Live Docs example and it worked perfectly.
Try it at:
Scroll down to the end of the page, then type your RegExp and your TestValue and click the Validate button, it works. I am guessing that maybe it is your i flag, try removing it from your validator.
Hope this helps
I tried your suggestion and it did work there. I wanted to verify that it also worked with multiple serial numbers and since the validator example in the docs did not support that, I found an online validator which confirms that it works in that case as well. I'm at home now so I can't try it until tomorrow but why do you think the 'i' flag would cause it to misbehave?
Thanks for your help!
Well i suggested removing the i flag because on the Adobe's example they are not using it, so first of all you need to make sure that you can reproduce the Adobe's example behavior and from then modify whatever you need. I recommend this because the Adobe's example is already working so i think it is a good start.
What happens if you remove the i flag and use a TextInput instead of a TextArea?
I actually tried that as well but could not get it to validate that either. Very strange.
Very weird indeed. Ok how about passing the RegExp to the Validator as a String?
public var customExp : String = "[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9] [a-zA-Z0-9]( |,|\\n|\\r|\\t)";
I finally got it working like this:
The big takeaway from this is the textInput event does NOT work as advertised. Specifically, it does not fire when a deletion is made. Also, it requires me to add a space to the end of a serial number using the expression above in order for validation to be successful. Fortunately "keyUp" works fine :-)
Ohhh so it was fault of the events.......... :P
Glad you could make it work, mark your post as the answer to close this topic