header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
krishna
Points:0
Posts:0

10/7/2011 12:58:03 AM

Title: Restrct Special characters in text input


Hi All,

I want to display the alert pop up, if the user enters only special characters in text input.
How to implement? Please help me.

Thanks & Regards,
krishna



1
Asim
Points: 0
Posts:0
10/12/2011 3:40:05 AM



you can use the following function in flex to check if there are any special characters entered in the textbox. Using regex it will show you alert that invalid characters are there in the textbox

//actionscript function
protected function textinput1_changeHandler(event:Event):void
{
	// TODO Auto-generated method stub1
	var validAlphaNumericRegExp:RegExp= /^[a-zA-Z0-9]*$/;
	if(validAlphaNumericRegExp.test(mytext.text) == false){
	Alert.show("Text box contain invalid characters");
	};
}
// mxml
<mx:TextInput id="mytext" x="184" y="68" change="textinput1_changeHandler(event)"/>



Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 6+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions