Information générale
Catégorie:
Codage, syntaxe et commandes
Validate it on the client or server side?
I guess client side (browser) would be appropriate. If you use VBScript then IsDate() is the way to go. It will accept a number of short and long date formats (in a string expression) and return True if the date is valid. After you verify that it is a valid date you can format it before sending it to the server with the Format() function.
HTH
>I need to validate web data which is by default type string. The fields which are most difficult to validate are DATE type. I have written code over the years to validate such strings but I never felt satisfied that I was thorough. does anyone have any code suggestions for this validation. what I am interested in is strictly a valid date.
>
>9/14/01
>09/14/01
>09/14/2001
>01/14/09
>09-14-01
>09-14-2001
>09.14.01
>
>and on and on
>
>Thanks
>
>Glenn
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement