JQuery Ninja and ZIP Codes
Jumping in with both feet tends to be my favorite way of learning more about the skills I need for my career. Today I was fortunate enough to be handed a task at work that allows me to do just that. The task is that of setting up our standardized order form(s) to automatically populate city and state based on user input of ZIP code.
I immediately knew what needed to be done, and a good percentage of how to do it, but some amount I knew to be new territory to me. The sum of the work would be to have a query sent to a database that includes zip, city and state data to request the latter two portions when the former portion is filled out on the form and populate the city and state fields on the form based on that. Setting up the database and inserting the data has proved to be trivial. The unknown part is using AJAX to connect to a database and insert the appropriate values in the appropriate areas of the form.
I have had a hate/hate relationship with javascript for a very long time, for very good reasons. That time has past and those reasons no longer exist and it is up to me to step up and learn javascript/AJAX. This is where a book I received not too long ago, JQuery: Novice to Ninja, comes into the picture. If you are new to AJAX, as I am, and want to learn, I highly recommend starting out with this book.
Now it’s back to reading and working on getting this project together. If all goes well, I expect to write up a how-to document explaining everything that went into developing this project. I also plan to look into how best to make this available for Codeigniter. I am not sure if it is better suited as a plugin, helper, library or some other form, but I expect it would be a useful pursuit, regardless.