Re: QuickForm Check Date

From: Date: Thu, 23 Dec 2004 03:51:37 +0000
Subject: Re: QuickForm Check Date
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16423@lists.php.net to get a copy of this message
Massimiliano Arione escreveu:
I search in the list and the only QUICKFORM checkdate function that i find don´t is functioning. Somebody have a solution for this?
function qf_date($date) {
    if ($date['m'] != '' && $date['d'] != '' && $date['Y'] != '') {
        return checkdate($date['m'], $date['d'], $date['Y']);
    }
    return false;
} Of course, you should replace the empty '' with whatever you choose for the emptyOptionText in your date element (or simply ignore it if you don't set addEmptyOption to true) Then you can do the usual registerRule and addRule Thank you Massimiliano Arione, this code is very useful!
Jacques, from Brazil. -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 15/12/2004

« previous php.pear.general (#16423) next »