Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34378

mx:DateValidator allows multiple separator chars

    XMLWordPrintableJSON

Details

    Description

      With Adobe Flex 4.12, the following validator declaration reports no validation error for input string "12/////12/////2012".

      With Apache Flex 4.6 this leads to a validation error, which is the correct behaviour.

      <?xml version="1.0" encoding="utf-8"?>
      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
      					   xmlns:s="library://ns.adobe.com/flex/spark" 
      					   xmlns:mx="library://ns.adobe.com/flex/mx">
      	<fx:Script>
      		<![CDATA[
      			import mx.controls.Alert;
      		]]>
      	</fx:Script>
      	
      	<fx:Declarations>
      		<mx:DateValidator
      			source="{enteredDate}" 
      			property="text" 
      			inputFormat="mm/dd/yyyy"
      			wrongLengthError="The date format is not correct"
      			allowedFormatChars="/ - ."
      			trigger="{checkDate}" 
      			triggerEvent="click"
      			valid="{Alert.show('Date is valid')}"
      			invalid="{Alert.show('Date is invalid')}"/>
      	</fx:Declarations>
      	
      	
      	<mx:Text text="Enter date (mm/dd/yyyy or mm-dd-yyyy or mm dd yyyy):"/>
      	<mx:TextInput y="150"
      				  id="enteredDate" />
      	<mx:Button y="75"
      			   label="Check Date" id="checkDate"/>
      	
      </s:WindowedApplication>
      

      Attachments

        1. FLEX34378.patch
          5 kB
          Chris Martin

        Activity

          People

            jmclean Justin Mclean
            veryflexible Mara Cou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: