Re: QuickForm [files]

From: Date: Tue, 14 Oct 2003 14:13:31 +0000
Subject: Re: QuickForm [files]
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8425@lists.php.net to get a copy of this message
Hi! Daniel Demacek wrote:
Hello, consider:
$ph = Array();                                                      for($i=0; $i<10; $i++)                                          {                                                                        $ph[] = &HTML_QuickForm::createElement('file','img'.$i, null); }                                                                   $form->addGroup($ph, 'photo', 'Photos:', '<br/>');             
I have a strong suspicion that grouping 'file' elements does not quite work now. I'll be looking into this soon.
# how would I add rules for each file? # this doesn't work :(
"This doesn't work" is everyone's favourite way to learn about a problem.
$form->addRule('photo', 'Cannot exceed '.(104857/1024 ).'KB', 'maxfilesize', 104857); $form->addRule('photo', 'Must be JPG', 'mimetype', array('image/jpeg', 'image/pjpeg')); $form->addRule('photo', 'Must be *.jpg', 'filename', '/^.*\.jpg$/');


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