Have been working on a serious of frameworks by now. Most mature frameworks have their own validation framework. This ensures that field validation are handled in a standard way. Hmmm, does Joomla have something similar?
Let’s Investigate.
Step 1: I tried to submit an article via the front end. Was confronted with a javascript alert box that says:
Article must have a Title
Step 2: Looked into the backend.. and I see semblance of validation logic at the javascript:
function submitbutton(pressbutton)
Step3: Investigate code at:
http://localhost/joomla/index.php?option=com_content&view=article&layout=form&Itemid=4&lang=en
Well, looking at the url, we can conclude that we will need to look into:
com_content/views/article/tmpl/form.php
Alamak… no luck. The validation logic is all hard coded. Looks like the validation framework is just not robust enough….
Step4: Google online
Fantastic! Seems like we can do the validation just by setting some classes to the form elevements!
http://docs.joomla.org/Form_validation
i.e. for both required and email validation, use:
<input type="text" name="email" size="30" class="required validate-email"/>





