|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Flash data format Question from jsp developer
I am on my first flash program, and now loosing what little hair I have left.
Until recently our flash front end would tell us that a date was not of mm/dd/yyyy format. Now our flash front end is accepting 12/12/1 and zero filling the year to be 0001. Could someone kindly point me in the right direction to force the date fields to require all 8 digits plus the slashes? My brain feel like I am trying to modify sendmail.cf files. ![]() |
|
#2
|
|||
|
|||
|
Quote:
lol - know how ya feel. just keep digging.. just how this stuff is (most of the time) date = date.text for starters: 8 + 2 slashes = 10 so you can do: Code:
if (date.text.length == 10){
// date length is valid
// do some indexOf("/") checks
// while were at it we might want to check to see if values are numeric
}
else{
// can check if it's too short too long whatever.. or just not valid
}
Code:
you can also use :
If (date.text.indexOf("/") != 3) {
// missing slash in 3rd spot of string
}
indexOf() returns the character "number" where the value in parentheses is first found in a string. or in this case _ _ / = 3 you can also use lastIndexOf() to return the positon of the 2nd slash .. you could have all this in a function called valitateDate(){ //check the date string // If good submit form } your submit button could be on (release) { valitateDate(); } hope this helps.. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > Flash data format Question from jsp developer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|