QuickForms: Max file size validation
| From: | toni | Date: | Thu, 25 Nov 2004 11:43:06 +0000 |
| Subject: | QuickForms: Max file size validation | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15808@lists.php.net to get a copy of this message | ||
Hi all,
I want to put two file elements in the same QForm with two rules like
these:
$this->addRule('userfile','Too
big','maxfilesize',1048576,'client');
$this->addRule('userfile2','Too
big','maxfilesize',2097152,'client');
with different max-size.
But this only insert a html line:
<input name="MAX_FILE_SIZE" type="hidden" value="1048576" />
and the javascript validation blocks:
value = frm.elements['userfile'].value;
if (value != '' && !_ruleCheckMaxFileSize(value, '1048576') &&
!errFlag['userfile']) {
errFlag['userfile'] = true;
_qfMsg = _qfMsg + '\n - El fichero de imagen es demasiado grande.';
}
value = frm.elements['userfile2'].value;
if (value != '' && !_ruleCheckMaxFileSize(value, '2097152') &&
!errFlag['userfile2']) {
errFlag['userfile2'] = true;
_qfMsg = _qfMsg + '\n - El fichero es demasiado grande.';
}
And the client validation doesn't work!
Any suggestions?
Thanks.
Toni.