Complex Form Validation in Joomla

52 views
Skip to first unread message

Paul van Haren

unread,
Apr 17, 2019, 9:25:21 AM4/17/19
to Joomla! General Development
Hi,

I'm trying to implement complex form validation for a module admin form. The form validation will require a couple of form fields and then run some queries on the Internet. I'm looking for advice how to best implement this.

I've come across the onContentNormaliseRequestData event, and I think I can make this work more or less, but it doesn't feel optimal. 
  1. onContentNormaliseRequestData is triggered before the server-side field validators are executed. Thus,the order of validations is not optimal.
  2. I don't know how to pass return information or error messages from the plug-in. It appears that nothings gets done with the error messages, nor with the return status, see libraries/src/MVC/Controller/FormController.php.ModulesControllerModule->save(): lineno 708
  3. I would have hoped that there is a simpler mechanism, similar to the server-side field validation mechanism, to implement such form validation.
Any help is appreciated.

Best regards, Paul

Mark Dexter

unread,
Apr 17, 2019, 10:50:55 AM4/17/19
to Joomla! General Development
Another approach would be to use a template override for the module edit view. That gives you complete control over the edit view. It's a bit of a kluge but it works.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send email to joomla-de...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages