inlineEdit and AngularJS

Recently I used the inlineEdit plugin with a project that uses AngularJS. As the inlineEdit plugin only handles switching between non-editable and editable views and exposes the save/cancel actions it was pretty easy to integrate. What I ended up doing was wrap the inlineEdit plugin with a Directive that implements the ngModelController API. Take a […]

First steps to using jQuery with CoffeeScript

A colleague recently asked me how you typically write the jQuery DomReady and closure syntaxes with CoffeeScript. It’s actually quite simple but did require a bit of fiddling around to find the right recipe. So I thought I’d share this with you all just in case you’re wondering too! DomReady: # CoffeeScript jQuery ($) -> […]

HTML5 Placeholders

HTML5 adds a new attribute to most form elements called a placeholder. Its purpose is to add a short hint inside data entry points that disappear on focus. This type of interaction isn’t new but is new to HTML as of version 5. For this reason not all browsers have implemented this feature. Try it […]

jQuery: Textarea maxlength

Being able to restrict the maximum length of user input from the interface directly is very convenient and practical in use. We do this a lot with input elements. Unfortunately textarea elements do not natively support the maxlength attribute. This attribute was finally added in HTML5 but at the time of writing Chrome is the […]

Tip: getting values from an options list

So, if you’ve ever converted an options list into a single array of values you might have intuitively done this: var select = $(‘#mySelectElement’)[0]; var values = new Array(); for (var i=0; i < select.length; i++) { values.push(select.options[i].value); } Pretty boring aye? There is a snazzier (is that a word?) alternative, which is to use […]