Remember
that in the earlier WML document, we have used the format
attribute to set the input mask of the birthday field to be
"NNNNNNNN". This input mask ensures that the birthday field
contains 8 numeric characters. Hence, we do not check for this in the
isDateValid() function.

At
the start of the isDateValid()
function, we make use of the subString()
function of the String standard library to extract the month, day and
year:

The
value returned from the subString()
function is of the string type. We need to use the parseInt()
function of the Lang standard library to convert them into the
integer type so that we can perform comparisons and mathematical
operations easily afterwards:

Next
we check the month value. If it is smaller than one or greater than
twelve, it is not a valid month value.

After
that we check the day value. April, June, September and November have
30 days. Other months have 31 days. February has 29 days in a leap
year, otherwise it has 28 days. If the year value can be divided by
4, then it is a leap year. For example, 2004 can be divided by 4 and
it is a leap year. If the day value is smaller than one or greater
than the number of days in that month, it is not valid.

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.