O'Reilly logo

Learning Joomla! 1.5 Extension Development by Joseph L. LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Requiring specific fields

When the restaurant critics are entering reviews into the system, there are a few fields on the form in the single view that they should always complete. As a minimum, we have decided that each review needs a Name, Address, and a Quicktake. Without these fields, a review is effectively useless. To enforce these requirements, we need to add some JavaScript that will intercept the events when the Save and Apply buttons are clicked, and check that these fields have been specified.

The JavaScript that we will add should test the value of each required field, then throw an alert and stop the form from submitting when any one of them is blank. The backend of Joomla! is configured so that whenever one of the toolbar buttons is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required