| Re: Form validation using XoopsForm and smarty template |
| by Codyko on 2006/1/6 8:47:28 Hi all, Sugar, aka RB , the Author of the magazine module is so nice that he provided me some hints at our local support site. Finally, I have solved the problem. Here is the summary of the solution : 1. Using xoopsform methods , create the prefered form eg include/form.inc.php : 2.In the php script eg submit.php where you need to use this form 3. Finally, in the smarty temmplate , ie templates/xinventory_category.html : le="color: #000000"><?php <{$form}> One more interest thing is that, I cannot not use $form->insertBreak() in "include/form.inc.php" if I don't use $form->display(); but the above solution can get rid of this. Hope this helps others ! Regards Cody
|
| Form validation using XoopsForm and smarty template |
| by Codyko on 2006/1/5 8:07:04 Hi! I am using XOOPS version 2.2.3. I have problem when using form validation with xoopsform and smarty template together; Ok, I have the form like this : le="color: #000000"><?php $form = new XoopsThemeForm($formTitle, "categoryform", $formAction, "POST"); $form->addElement(new XoopsFormText(_MD_XINVENTORY_CATEGORY_NAME, "catname", 30, 60,$catNameValue),true); $form->assign(&$xoopsTpl); The form can be rendered through a template but I found that form validation at the "catname" field doesn't work unless I change. ie. It won't warn of empty string. le="color: #000000"><?php $form->assign(&$xoopsTpl) tole="color: #000000"><?php $form->display() I notice that when using the display() method, a "*" is marked beside the "catname", but there is no such mark when using the template method. Any idea ? Thanks Cody
|