Archive for the ‘Javascript’ Category

Get a <li> elements index value on click with jQuery

Get a <li> elements index value on click with jQuery

Posted on: December 17th, 2011 by deanpugh

Recently I needed to find out the element index of a List element when clicked. I managed to come up with the code that enabled me to do that using jQuery. First you need to set up your HTML code with an id of ‘bourne’. You don’t have to use bourne, use whatever you like. […]

Online Testing With jsfiddle.net

Online Testing With jsfiddle.net

Posted on: December 16th, 2011 by deanpugh

A website that I recently found very useful was the JS Fiddle website. It basically sets up a test area for you to try out simple bits of code, saving you the time or creating a test area. It also has the nice feature of being able to set up as different versions of HTML, […]

Toggle Jquery UI Checkbox Array

Toggle Jquery UI Checkbox Array

Posted on: December 1st, 2011 by deanpugh

Ok, so the title may not explain what this post is about, but hopefully it covers the basics. Recently I have been rewriting a website, adding smarted code and classes. One of the new features I have added is Jquery UI. While this in itself is not new, it was new to this project. One […]

Pre Check Form Before Submit

Pre Check Form Before Submit

Posted on: November 8th, 2011 by deanpugh

Below is a script to allow you to run a precheck function in Javascript, preventing the form from submitting if you detect a problem. First, in a separate, external Javascript file, copy the below script: The above code is checking a checkbox value in the sent form to see if it has been selected. If it has, then […]