Move Gravity Forms field labels above input fields

Gravity Forms has some nice compound fields to make it easy to accept things like names, addresses, and credit card details. One annoying thing it does, though, is put the labels for the input fields below them instead of above them. Here’s how to move Gravity Forms field labels above input fields where most people would expect them to be. Continue reading Move Gravity Forms field labels above input fields

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail

sessionStorage with expiry time

Session storage is a very handy tool for caching content fragments retrieved via AJAX. Once we’ve pulled the content once, and stuffed it into session storage, we can access it again quickly without the overhead of a round trip to the server. But what if we want to limit the age of that content, so that it expires before it gets too stale? Continue reading sessionStorage with expiry time

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail

Add custom JavaScript actions to WP e-Commerce cart updates, again

I previously wrote about adding your own custom JavaScript actions to the WP e-Commerce cart update event. Of course, things change, people change, hairstyles change, interest rates fluctuate, WP e-Commerce moves goalposts, so there is a new way to do this since version 3.8.11 came out. Continue reading Add custom JavaScript actions to WP e-Commerce cart updates, again

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail

WooCommerce add to cart with quantity and AJAX

WooCommerce is a great e-commerce plugin for WordPress. It has some very nice basic features, but it’s also easy to customise and extend. On single product pages, you can add to cart with a quantity other than just one, and on the purchase page you can add to cart via AJAX without leaving the page. Wouldn’t it be nice to add to cart with both quantity and AJAX? Continue reading WooCommerce add to cart with quantity and AJAX

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail

Using jQuery’s ajaxSend event to change an AJAX request

Customisation of web software sometimes requires that you get it to pass around some additional information whenever it makes a page request. Often, putting that information into a cookie isn’t appropriate, so you try to squeeze it into the page query parameters, or form post data through hidden fields. But what if the software makes AJAX requests from jQuery? Luckily, jQuery can help you intercept AJAX requests so that you can customise them too. Continue reading Using jQuery’s ajaxSend event to change an AJAX request

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail

Load a nice jQuery UI theme in WordPress

WordPress now comes with a reasonably complete copy of jQuery UI, which you can easily incorporate into your themes and plugins using wp_enqueue_script. But it doesn’t come with any jQuery UI themes, leaving you to supply your own. Here’s how to make use of the standard themes easily. Continue reading Load a nice jQuery UI theme in WordPress

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail

Autocomplete in WordPress plugin admin

I just had to find a way to add autocomplete to an admin screen for a WordPress plugin I’m writing. Although a few pieces of jQuery UI are bundled into the WordPress distribution, that doesn’t include jQuery UI autocomplete. But on the way to investigating how to drop that into my plugin, I discovered that WordPress does bundle in a similar, simpler plugin called jquery.suggest. Continue reading Autocomplete in WordPress plugin admin

facebooktwittergoogle_plusredditlinkedinmailfacebooktwittergoogle_plusredditlinkedinmail