I need to do a php server side validation for the username field on the standard registration form (Joomla 2.5). How is this achieved please, and in which file do I add it to? Thanks.
Asked
Active
Viewed 4,550 times
1 Answers
1
I recommend you read Joomla Developer documentation. Also read this docs to find out how to use Joomla Forms with client and server side validation.
Here is a more general doc: Joomla Server-side form validation
-
Hi thanks for the links. I've got the code all together, now need to work out how to set it to actually validate. It's an if else statement, if matches, it should validate. If it doesn't (else), it should not validate. Any advice? – theoth Apr 15 '12 at 21:13
-
2in controller call `$data = $model->validate($form, $requestData);` then do `if ($data === false) { // raise error } else { $model->save($requestData); }`... obviously this is short version, look at other components on how this is implemented. – Alex Apr 16 '12 at 01:56