<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Lee &#187; Jquery</title>
	<atom:link href="http://www.weblee.co.uk/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weblee.co.uk</link>
	<description>PHP Freelance Developer</description>
	<lastBuildDate>Sun, 19 Jul 2009 14:38:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Secure Jquery Ajax Request</title>
		<link>http://www.weblee.co.uk/2009/06/25/secure-jquery-ajax-request/</link>
		<comments>http://www.weblee.co.uk/2009/06/25/secure-jquery-ajax-request/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 16:37:56 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[ajax]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=264</guid>
		<description><![CDATA[As we have seen in our previous Ajax requests we can grab data from different sources to output the the page. But what happens if the client has logged timmed out ?  Trying to send the client to a login page can be a little more tricky than it sounds.
In this screencast I will [...]]]></description>
			<content:encoded><![CDATA[<p>As we have seen in our previous Ajax requests we can grab data from different sources to output the the page. But what happens if the client has logged timmed out ?  Trying to send the client to a login page can be a little more tricky than it sounds.</p>
<p>In this screencast I will show you a quick way to listen for unauthorized access and send the client to a login page.</p>
<p><span id="more-264"></span></p>
<p><object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2298113&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" width="562" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2298113&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" /><param name="quality" value="best" /></object></p>
<p>Screen Time: 12:20</p>
<p>Please see below the key piece of code you will need.</p>
<pre class="brush: jscript;">

	$().ajaxError(function(xhr, status, err){
   		if(status.status == 401)
   			window.location.href = '/welcome/login.php';
 	});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/25/secure-jquery-ajax-request/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Codeigniter Pagination Part 4</title>
		<link>http://www.weblee.co.uk/2009/06/12/codeigniter-pagination-part-4/</link>
		<comments>http://www.weblee.co.uk/2009/06/12/codeigniter-pagination-part-4/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 20:45:48 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=237</guid>
		<description><![CDATA[Hopefully this will be a fun screencast for you. We will be using Jquery $.ajax GET request combined with the Codeigniter Pagination Library.
Im sure you will be suprised how easy this is achieved.


Screen Time: 16:42
Download example files
Other Usefull Links:

jQuery BlockUI

]]></description>
			<content:encoded><![CDATA[<p>Hopefully this will be a fun screencast for you. We will be using Jquery $.ajax GET request combined with the <a title="Codeigniter Pagination Library" href="http://codeigniter.com/user_guide/libraries/pagination.html" target="_blank">Codeigniter Pagination Library</a>.</p>
<p>Im sure you will be suprised how easy this is achieved.<br />
<span id="more-237"></span><br />
<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2245514&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" width="562" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2245514&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" /><param name="quality" value="best" /></object></p>
<p>Screen Time: 16:42</p>
<p>Download example files <a href="http://www.weblee.co.uk/wp-content/plugins/download-monitor/download.php?id=7" class="source" title="Pagination 4"><span>here</span></a> .</p>
<p>Other Usefull Links:</p>
<ul>
<li><a title="jQuary Block UI" href="http://malsup.com/jquery/block/#overview" target="_blank">jQuery BlockUI</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/12/codeigniter-pagination-part-4/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Simple Jquery Ajax with Codeigniter Part 4</title>
		<link>http://www.weblee.co.uk/2009/06/10/simple-jquery-ajax-with-codeigniter-part-4/</link>
		<comments>http://www.weblee.co.uk/2009/06/10/simple-jquery-ajax-with-codeigniter-part-4/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 19:31:43 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=169</guid>
		<description><![CDATA[Hopefully by now you will have had a better understanding on how to use Jquery with Coedigniter. We have looked at the $.post &#38; $.get request so far and have passed some simple data between them.
In this the last part of this series we will take a look at the $.ajax  request. The $.ajax request [...]]]></description>
			<content:encoded><![CDATA[<p>Hopefully by now you will have had a better understanding on how to use <strong>Jquery with Coedigniter</strong>. We have looked at the $.post &amp; $.get request so far and have passed some simple data between them.</p>
<p>In this the last part of this series we will take a look at the $.ajax  request. The $.ajax request is very powerfull and far to much to talk about in this one screencast so I would strongly suggest you take a look at the <a title="Jquery Documentation" href="http://docs.jquery.com/" target="_blank">JQuery Documentation</a></p>
<p><span id="more-169"></span><br />
<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2235638&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" width="562" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2235638&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" /><param name="quality" value="best" /></object></p>
<p>Screencast Time: 19:18</p>
<p>Download Example Files <a href="http://www.weblee.co.uk/wp-content/plugins/download-monitor/download.php?id=6" class="source" title="Simple Jquery with Ajax"><span>here</span></a> .</p>
<p>In a future screencast we will have another look at the Ajax request on how we can make better use of it for multiple ajax request throughout your site. So be sure to follow us by the RSS feed or Twitter.</p>
<p>Thank you for tunning in <img src='http://www.weblee.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/10/simple-jquery-ajax-with-codeigniter-part-4/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Simple Jquery Ajax with Codeigniter Part 3</title>
		<link>http://www.weblee.co.uk/2009/06/08/simple-jquery-ajax-with-codeigniter-part-3/</link>
		<comments>http://www.weblee.co.uk/2009/06/08/simple-jquery-ajax-with-codeigniter-part-3/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 22:39:41 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=168</guid>
		<description><![CDATA[So now we have looked at the $.get request we now are going to look at the $.post request.
In this screencast we can see how we can submit form data through this request.


Screencast Time: 14:04
All download files will be displayed on the last post.
]]></description>
			<content:encoded><![CDATA[<p>So now we have looked at the $.get request we now are going to look at the $.post request.</p>
<p>In this screencast we can see how we can submit form data through this request.</p>
<p><span id="more-168"></span><br />
<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2235350&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" width="562" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2235350&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" /><param name="quality" value="best" /></object></p>
<p>Screencast Time: 14:04</p>
<p>All download files will be displayed on the last post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/08/simple-jquery-ajax-with-codeigniter-part-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple Jquery Ajax with Codeigniter Part 2</title>
		<link>http://www.weblee.co.uk/2009/06/08/simple-jquery-ajax-with-codeigniter-part-2/</link>
		<comments>http://www.weblee.co.uk/2009/06/08/simple-jquery-ajax-with-codeigniter-part-2/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 15:17:47 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=167</guid>
		<description><![CDATA[Following on from part one in this screencast we will take a look at one of the Ajax functions $.get.
We will take a look at how to perfom a $.get request and how to handle the callback.


Screencast Time: 21:55
I will add a download on the last screecast of this series.
]]></description>
			<content:encoded><![CDATA[<p>Following on from part one in this screencast we will take a look at one of the Ajax functions $.get.</p>
<p>We will take a look at how to perfom a $.get request and how to handle the callback.</p>
<p><span id="more-167"></span><br />
<object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2235118&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" width="562" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2235118&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" /><param name="quality" value="best" /></object></p>
<p>Screencast Time: 21:55</p>
<p>I will add a download on the last screecast of this series.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/08/simple-jquery-ajax-with-codeigniter-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple Jquery Ajax with Codeigniter Part 1</title>
		<link>http://www.weblee.co.uk/2009/06/07/simple-jquery-ajax-with-codeigniter-part-1/</link>
		<comments>http://www.weblee.co.uk/2009/06/07/simple-jquery-ajax-with-codeigniter-part-1/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 19:51:05 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ci]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=148</guid>
		<description><![CDATA[I thought before I do my next screencast with pagination I would do an introduction with Jquery Ajax.
There are a number of excellent Javascript Frameworks (Prototype, Mootools, Dojo, Scriptaculous etc..) but my personal flavour is Jquey. Like Codeigniter it has a great user guide which is easy to follow and a great network of users. [...]]]></description>
			<content:encoded><![CDATA[<p>I thought before I do my next screencast with pagination I would do an introduction with <a title="Jquery Ajax" href="http://docs.jquery.com/Ajax" target="_blank">Jquery Ajax</a>.</p>
<p>There are a number of excellent Javascript Frameworks <em>(Prototype, Mootools, Dojo, Scriptaculous etc..)</em> but my personal flavour is Jquey. Like Codeigniter it has a great <a title="Jquery User Documention" href="http://docs.jquery.com/" target="_blank">user guide</a> which is easy to follow and a great network of users. And one of the great tools it has in its API is AJAX <em>(Asynchronous JavaScript and XML)</em>.</p>
<p><span id="more-148"></span><br />
I thought trying to explain it all in one screencast would be quite long so I have broken it down to 4. This first one explains on how easy Jquery can be to setup and some tools you mind find usefull.</p>
<p><object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2234834&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" width="562" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&#038;file=http%3A//blip.tv/rss/flash/2234834&#038;feedurl=http%3A//weblee.blip.tv/rss/&#038;autostart=false&#038;brandname=Web%20Lee&#038;brandlink=http%3A//weblee.blip.tv/" /><param name="quality" value="best" /></object></p>
<h3>Getting Prepared</h3>
<p>Screencast Time: 11:30</p>
<p>Download Firephp Library <a href="http://www.weblee.co.uk/wp-content/plugins/download-monitor/download.php?id=5" class="source" title="Firephp"><span>here</span></a> .</p>
<p>Constant Code:</p>
<pre class="brush: php;">
//
// Define Ajax Request
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
//
</pre>
<p>Helpful Ajax Testing Tools &amp; Setup:</p>
<ul>
<li><span style="text-decoration: underline;"><strong><a title="Javascript Framework" href="http://jquery.com/" target="_blank">Jquery</a></strong></span> &#8211; jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.</li>
<li><span style="text-decoration: underline;"><strong><a title="Edit, Debug &amp; Moniter your code" href="http://getfirebug.com/" target="_blank">Firebug</a></strong></span> &#8211; Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page. Cost: Free</li>
<li><span style="text-decoration: underline;"><strong><a title="Log PHP within the firebug console" href="http://www.firephp.org/" target="_blank">Firephp</a></strong></span> &#8211; FirePHP enables you to log to your Firebug Console using a simple PHP method call. Free</li>
<li><span style="text-decoration: underline;"><strong><a title="Web debugging Proxy Tool" href="http://www.charlesproxy.com/" target="_blank">Charles</a></strong></span> &#8211; Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers. Cost $50.00</li>
<li><span style="text-decoration: underline;"><strong><a title="Fiddler Web Debugging Tool" href="http://www.fiddler2.com/fiddler2/" target="_blank">Fiddler</a></strong></span> &#8211; Fiddler is a HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and &#8220;fiddle&#8221; with incoming or outgoing data. Cost: Free.</li>
<li><a title="Visual Jquery" href="http://www.visualjquery.com/" target="_blank">Jquery Visual</a> &#8211; Sometimes you just cant beat seeing how something actually work!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/07/simple-jquery-ajax-with-codeigniter-part-1/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Radio Button Replacement With Style</title>
		<link>http://www.weblee.co.uk/2009/05/30/radio-button-replacement-with-style/</link>
		<comments>http://www.weblee.co.uk/2009/05/30/radio-button-replacement-with-style/#comments</comments>
		<pubDate>Sat, 30 May 2009 00:20:28 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=16</guid>
		<description><![CDATA[I thought I would kick off this blog with a short tutorial on how you can make form radio buttons look and feel allot more interesting.
A recent job required the user to select a radio button which then on form submit depending on the result would load a specific page. OK im hearing you a [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would kick off this blog with a short tutorial on how you can make form radio buttons look and feel allot more interesting.</p>
<p>A recent job required the user to select a radio button which then on form submit depending on the result would load a specific page. OK im hearing you a normal set of radio buttons would have done the job fine but it just looked so boring and took up so little space. So I decided that with a bit of CSS &amp; Jquery magic we could make it look allot more interesting.</p>
<p><span id="more-16"></span></p>
<div id="action">
<ul>
<li><a class="demo" href="/demos/radio-replacement/index.html" target="_blank"><span>Demo</span></a></li>
<li><a href="http://www.weblee.co.uk/wp-content/plugins/download-monitor/download.php?id=1" class="source" title="Radio Button Replacement"><span>Radio Button Replacement</span></a> </li>
</ul>
<div class="clear-action"><span>clear</span></div>
<div class="clear-action"><span><br />
</span></div>
</div>
<p>First lets start of with a normal form with a set of radion buttons.</p>
<pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Fancy Checkbox&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;h2&gt;Check an Option&lt;/h2&gt;

&lt;form action=&quot;step2.html&quot; method=&quot;post&quot; id=&quot;radioform&quot;&gt;
Option 1: &lt;input name=&quot;option1&quot; type=&quot;radio&quot; value=&quot;option1&quot; id=&quot;option1&quot; checked=&quot;checked&quot; /&gt;&lt;br /&gt;
Option 2: &lt;input name=&quot;option1&quot; type=&quot;radio&quot; value=&quot;option2&quot; id=&quot;option2&quot; /&gt;&lt;br /&gt;
Option 3: &lt;input name=&quot;option1&quot; type=&quot;radio&quot; value=&quot;option3&quot; id=&quot;option3&quot; /&gt;&lt;br /&gt;
Option 4: &lt;input name=&quot;option1&quot; type=&quot;radio&quot; value=&quot;option5&quot; id=&quot;option4&quot; /&gt;&lt;br /&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Ok now we have our basic form we need to add our styled buttons and tick to show which radio button is active. I have provided in the download the PSD&#8217;s for this example but lets see the code. Below you can just see the HTML for the list elements but I have used used css sprites for the hover over / active states <em>(basically one image for both states)</em>.</p>
<pre class="brush: xml;">
&lt;div id=&quot;options&quot;&gt;
&lt;ul id=&quot;list&quot;&gt;
&lt;li class=&quot;active&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;option1 active&quot; id=&quot;link1&quot;&gt;&lt;span&gt;Option&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;option2&quot; id=&quot;link2&quot;&gt;&lt;span&gt;Option&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;option3&quot; id=&quot;link3&quot;&gt;&lt;span&gt;Option&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;option4&quot; id=&quot;link4&quot;&gt;&lt;span&gt;Option&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>So now to the Javascript. We need to bind the click function to see which link we have clicked then update the checkbox and then update the list to reflect this action. We will use Jquery Selector <a title="Jquery Selector Hierarchy" href="http://docs.jquery.com/Selectors/child#parentchild" target="_blank">Hierarchy (parent &gt; child)</a> method which looks like this.</p>
<pre class="brush: jscript;">
$(document).ready(function () {
$(&quot;#list li &gt; a&quot;).click(function (event) {
// Work starts here
});
});
</pre>
<p>So now we have a click event function which will trigger once we click on any of the list links. We will now need to remove all active elements as trying to add/remove from each one will create extra code.</p>
<pre class="brush: jscript;">
$(document).ready(function () {

$(&quot;#list li &gt; a&quot;).live('click', function (event) {
// First disable the normal link click
event.preventDefault();

// Remove all list and links active class.
$('#list &gt; li, #list &gt; li a').removeClass(&quot;active&quot;);
return false;
});
});
</pre>
<p>Ok thats working nicely but now the fun part. We need to grad the link clicked ID and then make the correct radio button to checked and update the CSS.</p>
<pre class="brush: jscript;">
$(document).ready(function () {

$(&quot;#list li &gt; a&quot;).live('click', function (event) {
// First disable the normal link click
event.preventDefault();

// Remove all list and links active class.
$('#list .active').removeClass(&quot;active&quot;);

// Grab the link clicks ID
var id = this.id;

// The id will now be something like &quot;link1&quot;
// Now we need to replace link with option (this is the ID's of the checkbox)
var newselect = id.replace('link', 'option');

// Make newselect the option selected.
$('#'+newselect).attr('checked', true);

// Now add active state to the link and list item
$(this).addClass(&quot;active&quot;).parent().addClass(&quot;active&quot;);

return false;
});

});
</pre>
<p>And that&#8217;s it !!. You now have with just a few lines of code a nice replacement for your radio buttons.</p>
<p>Hope you enjoyed it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/05/30/radio-button-replacement-with-style/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
