티스토리 뷰

Lastupdate 2014. 12. 03 

한글,영어,혹은 숫자만 입력받을수 있게 하는 restrict 속성

[소스]

<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="233" height="172" minWidth="233" minHeight="172"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:TextInput x="49" y="36" prompt="한글만 입력가능" restrict="ㄱ-힣"/> <s:TextInput x="49" y="66" prompt="영어만 입력가능" restrict="a-zA-Z"/> <s:TextInput x="49" y="96" prompt="숫자만 입력가능" restrict="0-9"/> <s:TextInput x="49" y="126" prompt="숫자만 입력안되게" restrict="\-\.^0-9"/> </s:Application>

[실행화면]