In web development, form validation is undeniably a crucial asset to avoid errors when submitting data to a database. Sounds like a tedious job you say? Enter jQuery, one of the most useful and intuitive web tools of the last decade which takes what is potentially hours of writing javascript and turns it into just a few lines of code.
Similar to the way that most Apple products have “an app for that”, jQuery usually has a plugin for any otherwise time-consuming task. The tool, designed to simplify client-side scripting in HTML, and it does the job to a standard far above expected.
Client-side validation certainly has it’s advantages. Not only does it dramatically reduce unnecessary trips back and forth to the server, it can also improve the user’s experience visually when completing a form on the web. With jQuery validation, we can create an extra class which is to be applied to form fields whose data entered is incorrect, so when we add the script, the user is prompted to fill in the form correctly before any call is made to the server.
Form validation can also be implemented using PHP. It is advisable to remember that not everybody browsing the web will have javascript enabled so it is still highly recommended to use some server side validation alongside jQuery to ensure that any data is submitted correctly. As jQuery is client-side and PHP is server-side, the jQuery will always run first so users with javascript enabled will save pointless round trips to the server.
As the Not Web Design newbie, I see jQuery as a tool which has been a catalyst in my learning process so far and I am sure I will enjoy learning how to use more of it’s plugins in the future.
Great news for all Joomla developers!
After developing a few custom components for our clients, we realized just how long and time-consuming it can be, just to create all the files necessary to make a new Joomla 1.5 component, following the MVC standards. Immediately, we realized that a lot of this process was very tedious and repetitive and could be automated if only somebody created some software that did this for the developer… and so we did!
We have created the Joomla Component Creator - which has already saved us hours of development time - and decided to share it with you all.
The Joomla Component Creator creates all the files necessary; views, helpers, controller, etc. as well as creating all the necessary, appropriately named classes and also version, author and licensing information in the header comment of all the files.
We have already had lots of people trying this tool out for themselves and already a good amount of positive feedback. We hope you like it and it saves as much time for you as it has done for us! If you like it, we would appreciate your reviews.
One of the most tedious things about search is that you have to go back to the search result after viewing a matching page before you can go to the next matching page.
Wouldn’t it be nice if you could click previous and next directly on the page of all the matching pages and thus browse through all the results without having to go back to the result page? Well - read on for the answer to how this is possible and so difficult to achieve.
Searching for real estate?
The above mentioned problem is especially obvious when searching for properties on a real estate web site or any other web site where it is unlikely that anyone result will be the “correct” match. On these sites it is a great feature to make it possible to browse the matching results from a search directly from the resulting pages.
Saving the query and not the result list
The problem facing developers is to make the results available in the correct order on the actual resulting (matching) pages. Initially you might think that the best option is to save a list of all the results in a long array and then look that up on the individual resulting pages, and that could be a way to do but not if you use pagination on your results pages.
Let us say that you have found 2000 matches - hopefully you will not show all 2000 results on one long page, but instead break the pages up with say 10 results per page (like Google). Now if you have done your SQL correctly you will have made a lookup with LIMIT in it so that SQL only returns a certain amount of results. This leaves us with the problem that we can not make an array with ALL the results in it - because they are simply not available.
Instead we should save the SQL QUERY and pass that on to the matching pages when viewed.
Using the query and the position of the result that was clicked on you can create your previous/next buttons on the details pages. It works really well and saves lots of time for the browser.
Example and what about Google?
You can see our implementation on http://www.livingstone-estate.com simply perform a search and view one of the results and then enjoy the page flipping.
I wonder how long it will be before someone creates this as a Firefox extension for Google? It would be great to be able to scroll the result without having to go back to Google? Wouldn’t it?