You are here: QF & FB duplicate element form « PHP « IT news, forums, messages
QF & FB duplicate element form

Posted by Jorge on 09/29/98 11:29

Hi guys!

I'm getting crazy about the following error working with QuickForm +
FrontBuilder for a sign up form.

As usual, login / passwd are shown in form by FB:

<code>
[......]
$auth = DB_DataObject::factory('auth');
$fb_auth =& DB_DataObject_FormBuilder::create($auth);
$frm_auth =& $fb_auth->getForm();
$auth->postGenerateForm(&$frm_auth,&$fb_auth);
[....]
</code>

I need user retypes password, then I added postGenerateForm() function
within Auth class. I also added preProcessForm() for encrypt passwd and
it works.

<code>
[.....]
function postGenerateForm(&$form,&$fb) {
// FALLA!! Repite dos veces el campo
$form->addElement('password', 'passwordR', 'Retype password',
array('size'=>32, 'maxlenght'=>32));
$form->addRule('passwordR', 'Retype password', 'required');
$form->addRule(array('password', 'passwordR'), 'Password does not
match.', 'compare');
}
function preProcessForm(&$data) {
if(isset($data['password'])) {
if($data['password'] != $this->password) {
$data['password'] = md5($data['password']);
}
}
//igualar id_user(auth) e id_user(users)
}
[....]
</code>

I think this should be work fine but text element passwordR is shown
three times instead two. If postGenerateForm() is not called then only
one password element is shown. Does anybody know why?

Thanks

--
Jorge Gonzalez y Hurtado de Mendoza
jorge.ghm@gmail.com
http://www.la-nevera.com
soon on your screen http://www.webgout.com, check it out

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация