I have a UI component calendar that populates a text box that I validate before I let the form send.
All works fine in this department until you put the date in the text box manually, then the form does not think there is a valid date. This is because I validate the two dates not by what’s in the textbox, but by what date the person chose in the calendar UI component.
Confusing I know.
:hair:
So, how can I take a date someone puts is a listbox and formulate it so it looks like this
There date = 2/31/2003
Formulates to inputday = 1
inputmonth = 31
inputYear = 2003
I think if I have it in this form I can validate the date against the current date.
Or, where is a good web site with form/date validation?
This is odd because it is the second post today I have seen with validation in ActionScript. I don’t understand why we are trying to validate at this level when perl and other server-side scripts have built in regular expressions to handle this anf I am not aware of any validation methods in actionscript. I could be wrong…Anybody seen otherwise?
I am outputting error messages in flash when the user chooses an incorrect date. If we do it on the server side, we will have to go to a new page to tell them the date is incorrect. :sigh:
No, that is the trouble I’m having, the validation does not come from what is in the textbox. It happens behind the scenes by what was selected in the calendar and the current date. How would you go about putting a date in a textbox and validating it?
Right now I am validating my selected calendar date like this
goodYear = (getTodayYear<=_root.calender_mc.getCYear);
if (goodYear) {
trace(“goodYear”);
}
goodMonth = (getTodayMonth <= _root.calender_mc.getCMonth);
if (goodMonth) {
trace(“goodMonth”);
}
This is not all the code, just letting you get the drift.