Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
j2eesatish #1
combo box date validation
Hi,
As per our requirement, we need to put combo boxess for date input. we are
giving the user to input as dd month year format from the given combos. Can you
give me idea how to validate the date(feb 31 ..) from the given inputs. If it
is textbox, it will be ok. but our need is very particular about, comboboxes.
Thanks
j2eesatish Guest
-
[PHP] Date Validation, Kinda'
Now that I'm thinking about it, what is your goal with this? Is it to make sure the date entered is within a certain range when compared to another... -
Date Validation
I'm trying to find some Coldfusion code that will allow me to validate a date to make sure that it's in MM/DD/YY format and is actually a valid... -
Date Range Validation
Hello; CL_FRST (08/10/2004) and CL_LST (05/24/2005) holds the beginning and ending date of school calendar which is also prepopulated for every... -
Date Validation, Kinda'
Howdy, Has anyone written any date validation function or sequence. I have looked around, but haven't found anything. I am cobbling togather... -
date validation?
How to write an IsDate function that actually checks for a particular date format? Using try-catch on Convert.ToDateTime(sDate) doesn't catch... -
Mike Morearty (Adobe) #2
Re: combo box date validation
A DateValidator can validate against comboboxes as you describe. Here is an
example. With the following code, try entering an invalid date such as Feb.
31, and then pressing the Submit button; you will see a red border around the
Day field, and when you hover over it, you will see text that says, "Enter a
valid day for the month."
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:HBox>
<mx:ComboBox id="day" prompt="day" rowCount="31" dataProvider="{days}" />
<mx:ComboBox id="month" prompt="month" rowCount="12" dataProvider="{months}" />
<mx:ComboBox id="year" prompt="year" rowCount="20" dataProvider="{years}" />
<mx:Button label="Submit" id="submit" />
</mx:HBox>
<mx:DateValidator
daySource="{day}" dayProperty="selectedItem"
monthSource="{month}" monthProperty="selectedItem"
yearSource="{year}" yearProperty="selectedItem"
trigger="{submit}" triggerEvent="click"
/>
<mx:Array id="years" />
<mx:Array id="days" />
<mx:Array id="months" />
<mx:Script>
<![CDATA[
private function init():void
{
var i:int;
for (i = 1900; i <= 2006; ++i)
years.push(i);
for (i = 1; i <= 31; ++i)
days.push(i);
for (i = 1; i <= 12; ++i)
months.push(i);
}
]]>
</mx:Script>
</mx:Application>
Mike Morearty (Adobe) Guest
-
j2eesatish #3
Re: combo box date validation
Thanks a lot!
The code looks fine. It will bbe exactly suited for our requirement. But, i
am getting some errors while executing the code. here the given exampel include
the line <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">.
but our application is <mx:Application
xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="loadme()">
Will this exaple will not suite for the macromedia mxml form? i ve change as
adobe. but the application is not able to recognize this!. Can you give me some
help on this!
Thanks
j2eesatish Guest
-
ntsiii #4
Re: combo box date validation
You must be running version 1.5.
There is enfough difference between the tow to make reverse migration very
difficult. Using the docs and this example, though, you might be able to see
what is needed.
If you indicate the Flex version you are using in you post, it will save
everyong a lot of time.
Tracy
ntsiii Guest



Reply With Quote

