0

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.

theoth
  • 127
  • 3
  • 11
  • Hi, thanks for the reminder, still quite new here... I've updated my questions, and I'm waiting for a reply on one or two still.. Any help about the above? – theoth Apr 12 '12 at 22:10

1 Answers1

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

e-motiv
  • 5,795
  • 5
  • 27
  • 28
Alex
  • 6,441
  • 2
  • 25
  • 26
  • 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
  • 2
    in 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