Ajax Forms Processing

Written By: Editor - Feb• 18•11

Forms. Lots of forms. We certainly use them often. My standard process for years has been post form data to PHP, transferring control from one page to the next. But I am having to un-learn the habit of jumping from page to page because the user demands a more seamless experience. That means preloading and hiding content or loading new content with Ajax. I’ve been doing client-side form validation for a few years, but processing the form in the browser? That’s always seemed a bit dicey.

Thankfully, libraries like jQuery have worked out the kinks and quirks of various browsers. Many pioneers have gone before and fallbacks have been perfected. Just as we validate form data on both the client and the server, it is now very simple to add client-side form posts to a system that already has server-side form processing. Just add some magic Ajax and a stripped-down version of the submit handler on the server and, tada!, you’re a client-side genius.

Looking around today for a refresher on this topic I found four pretty good tutorials. I chose to share this one with you because it seems to cover all of the bases, from building a good form to good validation to proper submittal, and full circle back to replacing the form in the page with response text. Although it suggests handling the form info with PHP, the implementation is agnostic and could be used with whatever back end. One thing that none of the articles covered was fallback, but I’ve hinted at that above. Someday soon I’ll write up my own full tutorial, but until then, here is a very good one…

Submit A Form Without Page Refresh

List pagination with Pajinate

Written By: Editor - Feb• 17•11

Data heavy web apps are my bread and butter. Lots of tables, lots of SQL, and very often that means pagination. However, I had never even thought of using pagination for lists, whether ordered or unordered. It just never occurred to me that lists could get long enough to need that. Then one day I needed to make a long list of simple links, also known as an index. Duh. Scroll city or a confusing table of shorter lists. Or… wait, can you paginate list items?

Tada! Enter Pajinate. An elegant answer to a simple question. Exactly what the quizzical web dev needed. Thanks Wes Nolté!

Actually, this plugin can paginate any series of elements, but it is so simple and light that it is really ideal for lists. When it comes to tabular data I go with feature rich plugins… or (shhh) over to Ext JS ;-)

Two Weeks On

Written By: Editor - Feb• 16•11

Two weeks since the reboot of jQ-Mag and I have to say that I’m enjoying it. Feedback has been sparse, however, and the traffic is nothing to brag about, so the utility of the exercise is only measurable in terms of personal growth.

Thinking critically while reading posts, blogs, and tweets on jQuery is a more profitable exercise than just browsing. Using the 90/10 standard to filter the information I’m looking at does two things that improve the results from the time spent: first, I find myself throwing crap out more quickly. I don’t have time to struggle through bad grammar and poorly organized thoughts looking for kernels or helpful information. I just chuck it and move on. My brain sort of scans and says, “Hmm, crap… crap… um, maybe, no this is half crap… ew, crappy… more crap… Aha!”

Then, the second bonus kicks in. I take the time to read and evaluate the better items. Instead of just saying, “Hey, that’s decent”, I start looking for value as well as quality. What”re the use cases? Would it save me time? How’s documentation? Once I’ve gone through these exercises it becomes simple to write a short piece explaining why it is worthwhile and then catalog it for future use, whether by me or by you, the reader.

For these reasons the site will continue. As it moves along I hope to get back to the point in my own journey with jQuery that original content will naturally flow out of experiences. Here’s to better days ahead.

Elijah Manor

Written By: Editor - Feb• 15•11

@elijahmanor on Twitter is always on topic, even though he is not 100% jQuery. His blog is usually great, as well, and I especially want to point out today’s entry about Mocking jQuery Ajax Calls, which is a great way to test jQuery code and plugins before putting them on your server.  Better tutorial.

Elijah posts and tweets about jQuery quite often, but also covers ASP .NET, general Javascript, other .NET flavors, and web standards. He develops @ appendTo providing corporate support for jQuery, so everything from him is solid and scalable. I’ve been following him on Twitter a long time from various accounts and he is certainly prolific. Solid web dev follow.

Sliding Form

Written By: Editor - Feb• 15•11

Don’t you love it when you come across a site that has a really professional form for data entry? And don’t you hate it when a form looks like the browser puked? Give some form love to your site visitors. This little trick is not really a qualifying plugin and it is not a complete tutorial, but everything is there, it is pretty simple, and the result is a great form experience.

Basically, each fieldset gets its own “page” in the form and each page is on a separate tab, and the tabs slide as you navigate them. You don’t even have to click the tab buttons to navigate, because tabbing through the form takes you to the next page as focus changes. Try the demo, then you will want the code =)

Fancy Sliding Form

Overview of jQuery Essentials

Written By: Editor - Feb• 14•11

Just a quick shot to say that the jQuery Essentials slideshow by Marc Grabanski is still one of the best pieces for introducing Javascript users to jQuery. It gives people that lightbulb moment.