3 Replies Latest reply on Apr 27, 2010 12:23 PM by 55t56yh

    validating date and the slash caracter (/)



      i have been locking for a script code to allow me put in a text box a valid date, but the code have to insert automatically de slash bar how it looks in this example  http://www.tunait.com/javascript/?s=mascara#codigo

      in the format dd/mm/yyyy

      how i can do that??

      thenks for any kind of help


      pd: and no, its not using the dataformater propertie



      **** Ive been working on it and i have this


      <?xml version="1.0" encoding="utf-8"?>
      <!-- http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/ -->
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle"  backgroundColor="gray" creationComplete="init();">
                import mx.controls.TextArea;
                var patron = new Array(2,2,4);
                public function mascara(txt:String){
                     var aux:String=txt.replace("/","");     
                     var aux3:Array=new Array();
                     var l:Number=aux.length;
                     var cont:Number=0;
                     var salida:String="";
                          else if(cont==7)
           <mx:TextInput  keyUp="mascara(txtfecha.text)" id="txtfecha" maxChars="10" restrict="0-9,/" />



      but when i launch the program, de textbox show me the numbers in wrong position, and i dont know where are the error