<?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>Cappelen Art &#38; Design</title>
	<atom:link href="http://cappelendesign.no/feed/" rel="self" type="application/rss+xml" />
	<link>http://cappelendesign.no</link>
	<description></description>
	<lastBuildDate>Wed, 02 May 2012 08:56:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Added in portfolio: 3 paintings from WoW</title>
		<link>http://cappelendesign.no/2012/04/added-in-portfolio-3-paintings-from-wow/</link>
		<comments>http://cappelendesign.no/2012/04/added-in-portfolio-3-paintings-from-wow/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 20:04:53 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Work Added to Portfolio]]></category>
		<category><![CDATA[digital painting]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=4397</guid>
		<description><![CDATA[4368]]></description>
			<content:encoded><![CDATA[4368]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/04/added-in-portfolio-3-paintings-from-wow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Better Multiple Select with jQuery and PHP</title>
		<link>http://cappelendesign.no/2012/04/creating-a-better-multiple-select-with-jquery-and-php/</link>
		<comments>http://cappelendesign.no/2012/04/creating-a-better-multiple-select-with-jquery-and-php/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 20:08:41 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Coding]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[multiple select]]></category>
		<category><![CDATA[multiselect]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web form]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=4150</guid>
		<description><![CDATA[It&#8217;s about time for another tutorial. I wanted to share some code I&#8217;m using for administering a WordPress theme, but the principle can be applied to anything concerning multiple select in web forms. If you&#8217;re like me and think the standard HTML multiple select box just isn&#8217;t good enough &#8211; read on. In this tutorial [...]]]></description>
			<content:encoded><![CDATA[<img src="http://cappelendesign.no/wp-content/uploads/2012/04/multiselect-tutorial-first-300x193.jpg" alt="" title="multiselect-tutorial-first" width="300" height="193" class="alignright size-medium wp-image-4351" />
<span class="edit-note">Edit 19.04.12: Demo added.</span>
<p>It&#8217;s about time for another tutorial. I wanted to share some code I&#8217;m using for administering a WordPress theme, but the principle can be applied to anything concerning multiple select in web forms. If you&#8217;re like me and think the standard HTML multiple select box just isn&#8217;t good enough &#8211; read on.</p>
<p>In this tutorial I&#8217;ll explain how to extensively improve the standard multiple select box by using a jQuery script. The script transforms the dull and impractical select box into something much more user-friendly along with the ability to reorder the chosen elements. <em>I also show how you can retain the order of the selected items after the form is submitted</em> &#8211; something I couldn&#8217;t find a guide for out there in The Great Internet.</p>
<span id="more-4150"></span>

<a name="demo"></a>
<div class="demo-wrap"><div class="demo-button"><a href="http://cappelendesign.no/wp-content/uploads/code/multiselect/multiselect.php" target="_blank" title="Try a live demo">&nbsp;</a></div></div>

<h4>What&#8217;s so bad about the default HTML multiple select?</h4>
<p>As you may know, a multiple select is created by adding the argument <code>multiple="multiple"</code> to a <code>&lt;select&gt;</code> element. With the <code>multiple</code> argument the dropdown box changes into a solid box with the options listed inside &#8211; and allows selecting multiple items by holding down CTRL while clicking. For people less familiar with web forms it&#8217;s not intuitive to know that you need to hold down CTRL while clicking and that if you click on an item without CTRL down the selection disappears. To make such a select box user-friendly you&#8217;d have to at the very least write a paragraph somewhere explaining how to use it. And if the select box contains quite a few items, you&#8217;d need to scroll up and down. (In my example, listing around 160 blog names on a WordPress multisite makes it quite long and complex). Also, you can&#8217;t change the order of the selected items. Nay, we can do better &#8211; much better.</p>

<h4>Alright, I&#8217;m convinced. How can I make it better?</h4>
<p>The script we will be using is called <a href="http://quasipartikel.at/2009/05/10/jqueryui-multiselect/" target="_blank">jquery-ui-multiselect</a>. You can see demos and download the script <a href="http://www.quasipartikel.at/multiselect/" target="_blank">here</a> by clicking &#8220;Download&#8221; in the upper right corner. The zip comes with quite a few files, but you only need two files: the script itself <code>ui.multiselect.js</code> and the stylesheet <code>ui.multiselect.css</code>. If you want it translated into your language, open up the <code>js</code> file and write your version of the three strings at the very bottom.</p>

<p>This script is dependent on <a href="http://jquery.com/" title="jQuery's web site" target="_blank">jQuery</a> and <a href="http://jqueryui.com/" target="_blank" title="jQuery UI's web site">jQuery UI</a>, and needs a jQuery UI stylesheet (jQuery UI offers many different themes so you need to choose one). So we need to either download those scripts and stylesheets as well, or simply use a CDN service, such as <a href="http://code.google.com/apis/libraries/devguide.html" target="_blank" title="Google CDN service">Google CDN service</a>. I&#8217;ve chosen to do the latter.</p>

<p>Alright, that&#8217;s enough preperation. Let&#8217;s get to the code.</p>

<h4>The stylesheets</h4>
<p>First we make sure we load all necessary stylesheets inside the <code>&lt;head&gt;</code> of our web page. Here I&#8217;ve added jQuery UI&#8217;s theme <em>smoothness</em> via Google CDN. I&#8217;ve saved a copy of <code>ui.multiselect.css</code> and placed it inside a folder named <em>css</em>.</p>
<div class="wp_syntax"><pre class="php">
&lt;link <span class="b">rel</span>=<span class="r">'stylesheet'</span> <span class="b">href</span>=<span class="r">'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css'</span> <span class="b">type</span>=<span class="r">'text/css'</span> <span class="b">media</span>=<span class="r">'screen'</span> /&gt;  
&lt;link <span class="b">rel</span>=<span class="r">'stylesheet'</span> <span class="b">href</span>=<span class="r">'css/ui.multiselect.css'</span> <span class="b">type</span>=<span class="r">'text/css'</span> <span class="b">media</span>=<span class="r">'screen'</span> /&gt;
</pre></div>

<h4>The scripts</h4>
<p>Then we add the javascript files. We need jQuery, jQuery UI (both through CDN), and then the locally saved <code>ui.multiselect.js</code> inside a <em>js</em> folder &#8211; in that order.</p>
<div class="wp_syntax"><pre class="php">
&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span> <span class="b">src</span>=<span class="r">'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'</span>&gt;&lt;/script&gt;
&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span> <span class="b">src</span>=<span class="r">'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'</span>&gt;&lt;/script&gt;
&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span> <span class="b">src</span>=<span class="r">'js/ui.multiselect.js'</span>&gt;&lt;/script&gt;
</pre></div>
<p>We also need some initializing javascript code to actually use the script, but we&#8217;ll come to that later. Let&#8217;s start with creating the HTML form and the PHP to process the form first and see what we get.</p>

<h4>The web form</h4>
<p>For this tutorial&#8217;s and simplicity&#8217;s sake I&#8217;m defining a simple associative PHP array of the elements to go inside the multiple select box inside the php file. When the form is submitted, we&#8217;ll receive another PHP array containing the selected items, but as I don&#8217;t store it anywhere it will be reset on page reload. Normally you&#8217;d fetch and store the elements from and into a database or a global class or value &#8211; but that&#8217;s outside the topic in this tutorial.</p>

<p>Here is our basic form with an associative PHP array of possible (totally random) choices. Keep in mind that the form&#8217;s <code>enctype</code> need to be <code>multipart/form-data</code> in order to accept arrays when submitting, and the <code>&lt;select&gt;</code> element&#8217;s name need a <code>[]</code> after its <code>name</code> value. Otherwise you&#8217;d only be able to submit a single value.</p>

<div class="wp_syntax"><pre class="php">
<span class="y">&lt;?php <span class="b">$items</span> = <span class="l">array</span>(<span class="r">'1'</span> => <span class="r">'Apples'</span>, <span class="r">'3'</span> => <span class="r">'Carrots'</span>, <span class="r">'4'</span> => <span class="r">'Oranges'</span>, <span class="r">'7'</span> => <span class="r">'Raisins'</span>, <span class="r">'12'</span> => <span class="r">'Bananas'</span>, <span class="r">'14'</span> => <span class="r">'Pears'</span>, <span class="r">'15'</span> => <span class="r">'Chocolate'</span>, <span class="r">'18'</span> => <span class="r">'Grapes'</span>); ?&gt;</span> 
&lt;form <span class="b">enctype</span>=<span class="r">"multipart/form-data"</span> <span class="b">id</span>=<span class="r">"myform"</span> <span class="b">method</span>=<span class="r">"post"</span> <span class="b">action</span>=<span class="r">"index.php"</span>&gt;
	&lt;select <span class="b">name</span>=<span class="r">"selectitems[]"</span> <span class="b">id</span>=<span class="r">"selectitems"</span> <span class="b">multiple</span>=<span class="r">"multiple"</span> <span class="b">style</span>=<span class="r">"width: 200px; height: 100px;"</span>&gt;
		<span class="y">&lt;?php <span class="l">foreach</span> (<span class="b">$items</span> as <span class="b">$i</span> =&gt; <span class="b">$v</span>) { ?&gt;</span>
		&lt;option <span class="b">value</span>=<span class="r">"</span><span class="y">&lt;?php <span class="l">echo</span> <span class="b">$i</span>; ?&gt;</span><span class="r">"</span><span class="y">&lt;?php <span class="l">if</span> (<span class="l">in_array</span>(<span class="b">$i</span>, <span class="b">$selected</span>)) : <span class="l">echo</span> <span class="r">' selected="selected"'</span>; <span class="l">endif</span>; ?&gt;</span>&gt;<span class="y">&lt;?php <span class="l">echo</span> <span class="b">$v</span>; ?&gt;</span>&lt;/option&gt;  
		<span class="y">&lt;?php } ?&gt;</span>
	&lt;/select&gt;
	&lt;br/&gt;
	&lt;input <span class="b">type</span>=<span class="r">"submit"</span> <span class="b">name</span>=<span class="r">"save"</span> <span class="b">value</span>=<span class="r">"Save"</span> /&gt;
&lt;/form&gt;
</pre></div>
<p>The code above loops through the <code>$items</code> array and for each item it checks if the item&#8217;s inside the <code>$selected</code> array. In that case we set the option as selected.</p>

<p>So now we&#8217;ve got a form, but no PHP code which processes it when the <em>Save</em> button is clicked. Let&#8217;s add the form processing above the form &#8211; I&#8217;ve added it right after the <code>&lt;body&gt;</code> tag.</p>
<div class="wp_syntax"><pre class="php">
<span class="y">&lt;?php</span>
<span class="y"><span class="b">$selected</span> = <span class="l">array</span>();</span>
<span class="y"><span class="g">//form processing</span></span>
<span class="y"><span class="l">if</span> (<span class="l">isset</span>(<span class="b">$_POST</span>[<span class="r">'selectitems'</span>])) {</span>
<span class="y">	<span class="b">$selected</span> = <span class="b">$_POST</span>[<span class="r">'selectitems'</span>];</span>
<span class="y">}</span>
<span class="y"><span class="l">if</span> (!<span class="l">empty</span>(<span class="b">$selected</span>)) : <span class="l">print_r</span>(<span class="b">$selected</span>); <span class="l">endif</span>;</span>
<span class="y">?&gt;</span>
</pre></div>
<p>The above code checks whether a form was submitted. If so it stores the submitted array of choices into <code>$selected</code>. The last line is for debugging: if <code>$selected</code> contains something then print its contents &#8211; this is just so we can see what exactly was submitted.</p>

<img class="alignleft" title="Screenshot of the form submitted" src="http://www.cappelendesign.no/wp-content/uploads/misc/multiselect-tutorial-1.jpg" alt="" style="margin-right:10px;margin-bottom:10px;" />
<p>Now we&#8217;ve got a working form, which displays a default HTML multiple select box and stores the selected items into a PHP value when submitting the form.</p>
<p>As I was explaining above and what you see to the left it isn&#8217;t very user-friendly. The user has to scroll up and down to see all elements, and either know or be told to hold down CTRL when clicking for selecting multiple items. Also we can&#8217;t edit the order. What if the form submitter likes raisins better than apples?</p>

<p>It&#8217;s time to put the multiselect script to work on our select box.</p>

<h4>Doing some magic and replacing the default multiple select with something way better</h4>
<p>We&#8217;ve already loaded the necessary scripts and stylesheets (see above), so all we need to do is to initialize the script on document ready. You can add this piece of code in a js file that is included or do like me, add an <code>&lt;script&gt;</code> block in the header (<em>after</em> all script libraries).</p>
<div class="wp_syntax"><pre class="js">
jQuery(document).ready(function() {
	jQuery(<span class="r">"#selectitems"</span>).multiselect();
});
</pre></div>
<p>If you refresh your page now, the select box should&#8217;ve been replaced with the jQuery UI multiselect. PS: Since this select box setup requires more space, I&#8217;ve changed the select&#8217;s width to <code>450px</code> and height to <code>180px</code>. If you look closer in your HTML document (<a href="http://getfirebug.com/" target="_blank" title="Get Firebug for Firefox">Firebug for Firefox</a> is king), the original select box is hidden but the multiselect script retains the sizes you set on it and applies it to the new box.</p>
<img class="alignnone" title="Screenshot of the form with jQuery multiselect" src="http://www.cappelendesign.no/wp-content/uploads/misc/multiselect-tutorial-2.jpg" alt="" style="margin-right:10px;margin-bottom:10px;" />
<p>This looks great! You can now double-click or drag elements from the right into the left column, click the &#8220;-&#8221; to remove items, reorder the elements, add all or remove all with a single click, and even search for elements.</p>

<p>The form above works just fine. But I have one improvement to share.</p>

<h4>Making the multiple select retain the order after form submit</h4>
<p>If you look closer at the debug printout in the screenshot above, I&#8217;ve submitted the form with a rearranged order: raisins (ID 7), oranges (ID 4) and lastly apples (ID 1). But the order in the selected column is wrong &#8211; it&#8217;s been rearranged to follow the order of the <code>$items</code> array. So, <em>we receive the right order on form submission, but it isn&#8217;t reflected in the select box</em>. This can confuse the user thinking the reordering has gone bad, and force him or her to rearrange the items when changing the selection at a later time.</p>

<p>The solution is to modify the generation of the select box so we add the items in the selected array first and then add the other items excluding those which were added from the first array. In the first loop we loop through the <code>$selected</code> array and we set all items to be selected with <code>selected="selected"</code>, and in the second loop we skip items which can be found in <code>$selected</code>, and we don&#8217;t bother to set any as selected.</p>

<p>In our form code we replace the select box with this.</p>
<div class="wp_syntax"><pre class="php">
&lt;select <span class="b">name</span>=<span class="r">"selectitems[]"</span> <span class="b">id</span>=<span class="r">"selectitems"</span> <span class="b">multiple</span>=<span class="r">"multiple"</span> <span class="b">style</span>=<span class="r">"width: 450px; height: 180px;"</span>&gt;
	<span class="y">&lt;?php <span class="g">//first we add the list of selected items if any</span></span>
	<span class="y"><span class="l">foreach</span> (<span class="b">$selected</span> as <span class="b">$sel</span>) { ?&gt;</span>
	&lt;option <span class="b">value</span>=<span class="r">"</span><span class="y">&lt;?php <span class="l">echo</span> <span class="b">$sel</span>; ?&gt;</span><span class="r">"</span> <span class="b">selected</span>=<span class="r">"selected"</span>&gt;<span class="y">&lt;?php <span class="l">echo</span> <span class="b">$items</span>[<span class="b">$sel</span>]; ?&gt;</span>&lt;/option&gt;
	<span class="y">&lt;?php } ?&gt;</span>
	<span class="y">&lt;?php <span class="l">foreach</span> (<span class="b">$items</span> as <span class="b">$i</span> =&gt; <span class="b">$v</span>) { <span class="g">//then insert all items, skipping those who were added above</span></span> 
	<span class="y">	<span class="l">if</span> (<span class="l">in_array</span>(<span class="b">$i</span>, <span class="b">$selected</span>)) : <span class="l">continue</span>; <span class="l">endif</span>; <span class="g">//skip</span> ?&gt;</span>
	&lt;option <span class="b">value</span>=<span class="r">"</span><span class="y">&lt;?php <span class="l">echo</span> <span class="b">$i</span>; ?&gt;</span><span class="r">"</span>&gt;<span class="y">&lt;?php <span class="l">echo</span> <span class="b">$v</span>; ?&gt;</span>&lt;/option&gt;
	<span class="y">&lt;?php } ?&gt;</span>
&lt;/select&gt;
</pre></div>
<p>And there we have it &#8211; a highly user-friendly form with the possibility of rearranging the items.</p>

<h4>Demo and full example file</h4>
<p>In case you missed the demo, <a href="#demo">click the button earlier in the post</a> to see it in action. Here is the full index.php file I&#8217;ve used in case you get stuck on something.</p>
<div class="wp_syntax"><pre class="php">
&lt;!DOCTYPE <span class="b">html PUBLIC</span> <span class="r">"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span>&gt;
&lt;html <span class="b">xmlns</span>=<span class="r">"http://www.w3.org/1999/xhtml"</span>&gt;
	&lt;head <span class="b">profile</span>=<span class="r">"http://gmpg.org/xfn/11"</span>&gt;
		&lt;title&gt;Multiselect&lt;/title&gt;
		&lt;link <span class="b">rel</span>=<span class="r">'stylesheet'</span> <span class="b">href</span>=<span class="r">'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css'</span> <span class="b">type</span>=<span class="r">'text/css'</span> <span class="b">media</span>=<span class="r">'screen'</span> /&gt;  
		&lt;link <span class="b">rel</span>=<span class="r">'stylesheet'</span> <span class="b">href</span>=<span class="r">'css/ui.multiselect.css'</span> <span class="b">type</span>=<span class="r">'text/css'</span> <span class="b">media</span>=<span class="r">'screen'</span> /&gt;
		
		&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span> <span class="b">src</span>=<span class="r">'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'</span>&gt;&lt;/script&gt;
		&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span> <span class="b">src</span>=<span class="r">'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js'</span>&gt;&lt;/script&gt;
		&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span> <span class="b">src</span>=<span class="r">'js/ui.multiselect.js'</span>&gt;&lt;/script&gt;
		&lt;script <span class="b">type</span>=<span class="r">'text/javascript'</span>&gt;
			jQuery(document).ready(function() {
				jQuery(<span class="r">"#selectitems"</span>).multiselect();
			});
		&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
		<span class="y">&lt;?php</span>
		<span class="y"><span class="b">$items</span> = <span class="l">array</span>(<span class="r">'1'</span> => <span class="r">'Apples'</span>, <span class="r">'3'</span> => <span class="r">'Carrots'</span>, <span class="r">'4'</span> => <span class="r">'Oranges'</span>, <span class="r">'7'</span> => <span class="r">'Raisins'</span>, <span class="r">'12'</span> => <span class="r">'Bananas'</span>, <span class="r">'14'</span> => <span class="r">'Pears'</span>, <span class="r">'15'</span> => <span class="r">'Chocolate'</span>, <span class="r">'18'</span> => <span class="r">'Grapes'</span>);</span> 
		<span class="y"><span class="b">$selected</span> = <span class="l">array</span>();</span>
		
		<span class="y"><span class="g">//form processing</span></span>
		<span class="y"><span class="l">if</span> (<span class="l">isset</span>(<span class="b">$_POST</span>[<span class="r">'selectitems'</span>])) {</span>
		<span class="y">	<span class="b">$selected</span> = <span class="b">$_POST</span>[<span class="r">'selectitems'</span>];</span>
		<span class="y">}</span>
		<span class="y"><span class="l">if</span> (!<span class="l">empty</span>(<span class="b">$selected</span>)) : <span class="l">print_r</span>(<span class="b">$selected</span>); <span class="l">endif</span>;</span>
		<span class="y">?&gt;</span>
		
		&lt;div <span class="b">id</span>=<span class="r">"content"</span>&gt;
			&lt;form <span class="b">enctype</span>=<span class="r">"multipart/form-data"</span> <span class="b">id</span>=<span class="r">"myform"</span> <span class="b">method</span>=<span class="r">"post"</span> <span class="b">action</span>=<span class="r">"index.php"</span>&gt;
				&lt;select <span class="b">name</span>=<span class="r">"selectitems[]"</span> <span class="b">id</span>=<span class="r">"selectitems"</span> <span class="b">multiple</span>=<span class="r">"multiple"</span> <span class="b">style</span>=<span class="r">"width: 450px; height: 180px;"</span>&gt;
					<span class="y">&lt;?php <span class="g">//first we add the list of selected items if any</span></span>
					<span class="y"><span class="l">foreach</span> (<span class="b">$selected</span> as <span class="b">$sel</span>) { ?&gt;</span>
					&lt;option <span class="b">value</span>=<span class="r">"</span><span class="y">&lt;?php <span class="l">echo</span> <span class="b">$sel</span>; ?&gt;</span><span class="r">"</span> <span class="b">selected</span>=<span class="r">"selected"</span>&gt;<span class="y">&lt;?php <span class="l">echo</span> <span class="b">$items</span>[<span class="b">$sel</span>]; ?&gt;</span>&lt;/option&gt;
					<span class="y">&lt;?php } ?&gt;</span>
					<span class="y">&lt;?php <span class="l">foreach</span> (<span class="b">$items</span> as <span class="b">$i</span> =&gt; <span class="b">$v</span>) { <span class="g">//then insert all items, skipping those who were added above</span></span>
					<span class="y">	<span class="l">if</span> (<span class="l">in_array</span>(<span class="b">$i</span>, <span class="b">$selected</span>)) : <span class="l">continue</span>; <span class="l">endif</span>; <span class="g">//skip</span> ?&gt;</span>
					&lt;option <span class="b">value</span>=<span class="r">"</span><span class="y">&lt;?php <span class="l">echo</span> <span class="b">$i</span>; ?&gt;</span><span class="r">"</span>&gt;<span class="y">&lt;?php <span class="l">echo</span> <span class="b">$v</span>; ?&gt;</span>&lt;/option&gt;
					<span class="y">&lt;?php } ?&gt;</span>
				&lt;/select&gt;
				&lt;br/&gt;
				&lt;input <span class="b">type</span>=<span class="r">"submit"</span> <span class="b">name</span>=<span class="r">"save"</span> <span class="b">value</span>=<span class="r">"Save"</span> /&gt;
			&lt;/form&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre></div>
]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/04/creating-a-better-multiple-select-with-jquery-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript/CSS Performance Optimization</title>
		<link>http://cappelendesign.no/2012/03/javascriptcss-performance-optimization/</link>
		<comments>http://cappelendesign.no/2012/03/javascriptcss-performance-optimization/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 15:16:30 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Interesting Reading]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[griddler]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=3996</guid>
		<description><![CDATA[What affects browser performance and how can you optimize your javascript and CSS code in order to load the page faster? Explanations of web page rendering and examples of good and bad code, presented in a HTML5 slide-based webpage. I picked up some good points I can use to improve my long-forgotten Griddler game, which [...]]]></description>
			<content:encoded><![CDATA[<img src="http://cappelendesign.no/wp-content/uploads/2012/02/js-css-performance.jpg" alt="" title="js-css-performance" width="580" height="305" class="aligncenter size-full wp-image-4103" />
<p>What affects browser performance and how can you optimize your javascript and CSS code in order to load the page faster? Explanations of web page rendering and examples of good and bad code, presented in a HTML5 slide-based webpage.</p>
<p>I picked up some good points I can use to improve my long-forgotten <a href="http://cappelendesign.no/2010/06/personal-project-web-based-griddler-game/" title="Read my post: Personal project: Web-based Griddler Game">Griddler game</a>, which stalled because of poor performance.</p>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/03/javascriptcss-performance-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Work of Digital Speed Painter Nico Dimattia</title>
		<link>http://cappelendesign.no/2012/02/the-work-of-digital-speed-painter-nico-dimattia/</link>
		<comments>http://cappelendesign.no/2012/02/the-work-of-digital-speed-painter-nico-dimattia/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 14:24:41 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Artwork]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[speedpainting]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=3917</guid>
		<description><![CDATA[If you have ever searched for speed paintings on Youtube, you’ve probably seen the work of Nico Dimattia. Dimattia is an exceptional digital painter from Argentina who has received worldwide attention on his Youtube channel with his amazing speed painting videos. In this article we will feature some of his videos and artwork. Let’s take [...]]]></description>
			<content:encoded><![CDATA[<img src="http://cappelendesign.no/wp-content/uploads/2012/02/toy-story-3-nico-dimattia.jpg" alt="" title="Toy Story 3 Digital Painting by Nico Dimattia" width="495" height="274" class="aligncenter size-full wp-image-4112" />
<div class="external-piece"><p>If you have ever searched for speed paintings on Youtube, you’ve probably seen the work of Nico Dimattia. Dimattia is an exceptional digital painter from Argentina who has received worldwide attention on his Youtube channel with his amazing speed painting videos. In this article we will feature some of his videos and artwork. Let’s take a look!</p></div>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/the-work-of-digital-speed-painter-nico-dimattia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15 Best Android Tablets in The World</title>
		<link>http://cappelendesign.no/2012/02/15-best-android-tablets-in-the-world/</link>
		<comments>http://cappelendesign.no/2012/02/15-best-android-tablets-in-the-world/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 19:44:03 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Interesting Reading]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[tablet]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=4001</guid>
		<description><![CDATA[Fancy yourself a tablet, but not an iPad? Unsure which one to get? Techradar keeps an updated post with the current top 15 Android tablets, reviews included. (If I didn&#8217;t already have an iPad2, I&#8217;d totally fall for Asus Eee Pad Transformer Prime) Our list of the best Android tablets in the world &#8211; regularly [...]]]></description>
			<content:encoded><![CDATA[<img src="http://cappelendesign.no/wp-content/uploads/2012/02/best-android-tablets.jpg" alt="" title="best-android-tablets" width="425" height="327" class="aligncenter size-full wp-image-4024" />
<p style="padding-top: 10px;">Fancy yourself a tablet, but not an iPad? Unsure which one to get? <a href="http://www.techradar.com/" title="Techradar's website" target="_blank">Techradar</a> keeps an updated post with the current top 15 Android tablets, reviews included.</p>
<p>(If I didn&#8217;t already have an iPad2, I&#8217;d totally fall for <a href="http://www.techradar.com/reviews/pc-mac/tablets/asus-eee-pad-transformer-prime-1045764/review" title="Techradar's review of Asus Eee Pad Transformer Prime" target="_blank">Asus Eee Pad Transformer Prime</a>)</p>
<div class="external-piece"><p>Our list of the best Android tablets in the world &#8211; regularly updated. If you&#8217;re looking for a tablet and don&#8217;t fancy an iPad, then Android is currently the way to go.</p>
<p>Some tablets have ten-inch screens, others seven, and there are big differences in battery life, processing power and on-board RAM. So while we wait for the likes of the Samsung Galaxy Tab 7.7 and Amazon Kindle Fire, let&#8217;s see what the current best tablets are&#8230;</p></div>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/15-best-android-tablets-in-the-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dive into CSS3</title>
		<link>http://cappelendesign.no/2012/02/dive-into-css3/</link>
		<comments>http://cappelendesign.no/2012/02/dive-into-css3/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 10:30:32 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Interesting Reading]]></category>
		<category><![CDATA[Web Coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=4035</guid>
		<description><![CDATA[Good introduction to CSS3, showing examples and code for different types of gradients, rounded corners and shadows. Also check out the links to tools for CSS3 experimenting. Everyone who was ever interested in CSS3 has already tried it. Now we can generate rounded corners and drop shadows without any superfluous efforts. But it’s just a [...]]]></description>
			<content:encoded><![CDATA[<img src="http://cappelendesign.no/wp-content/uploads/2012/02/main_dive_into_css3.jpg.png" alt="" title="main_dive_into_css3.jpg" width="600" height="350" class="aligncenter size-full wp-image-4038" />
<p>Good introduction to CSS3, showing examples and code for different types of gradients, rounded corners and shadows. Also check out the links to tools for CSS3 experimenting.</p>
<div class="external-piece">
<p>Everyone who was ever interested in <strong>CSS3</strong> has already tried it. Now we can generate rounded corners and drop shadows without any superfluous efforts.</p>

<p>But it’s just a superficial level. I had to look into the new possibilities of browsers in more detail, to answer the arising questions like: to what extent gradients with a great number of colour transitions have the cross browser compatibility, where and how is it possible to apply at once a few shadows to the block, for what browsers prefixes of properties are used specifically etc.</p></div>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/dive-into-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another Top Favorite Android Apps</title>
		<link>http://cappelendesign.no/2012/02/yet-another-top-favorite-android-apps/</link>
		<comments>http://cappelendesign.no/2012/02/yet-another-top-favorite-android-apps/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 22:28:47 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apps]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=4007</guid>
		<description><![CDATA[I figured it was time for another round of Android apps since it’s been quite a development in the Android Market. Whether it’s competition or an inspiration of Apple apps, Android apps seem to have been taken up a notch lately – especially in terms of visual eye candy. Here you’ll find 12 apps; 5 [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright"><img title="Yet Another Top Favorite Android Apps" src="http://cappelendesign.no/wp-content/uploads/2012/02/android-market-rules-over-apple.png" alt="" /></div>

<div class="external-piece"><p>I figured it was time for another round of Android apps since it’s been quite a development in the Android Market. Whether it’s competition or an inspiration of Apple apps, Android apps seem to have been taken up a notch lately – especially in terms of visual eye candy.</p>

<p>Here you’ll find 12 apps; 5 new favorite games and 4 great miscellaneous apps, as well as 3 apps that I use because my phone is rooted.</p></div>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/yet-another-top-favorite-android-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Alternative to the Shortcode Madness</title>
		<link>http://cappelendesign.no/2012/02/an-alternative-to-the-shortcode-madness-part-1/</link>
		<comments>http://cappelendesign.no/2012/02/an-alternative-to-the-shortcode-madness-part-1/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 15:54:59 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Interesting Reading]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress admin]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=80</guid>
		<description><![CDATA[Ever having difficulties remembering shortcodes and their syntaxes, or getting complaints from your site&#8217;s authors about how adding shortcodes should be easier and more user-friendly? This tutorial shows how a theme can add shortcodes in a dropdown in the WordPress editor. I tend to spend a good amount of my time continuing to learn WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>Ever having difficulties remembering shortcodes and their syntaxes, or getting complaints from your site&#8217;s authors about how adding shortcodes should be easier and more user-friendly? This tutorial shows how a theme can add shortcodes in a dropdown in the WordPress editor.</p>
<img class="alignnone" title="an-alternative-to-the-shortcode-madness-part-1" src="http://cappelendesign.no/wp-content/uploads/2012/02/an-alternative-to-the-shortcode-madness-part-1.jpg" alt="an-alternative-to-the-shortcode-madness-part-1" width="570" height="300" />
<div class="external-piece">
<p>I tend to spend a good amount of my time continuing to learn WordPress and improve the ways I go about coding themes. With the vast majority of my WordPress development being done for clients, it is important to me to keep a good relationship with them. I feel part of maintaining that relationship is to provide a seamless, simple, and easy solution to their website project. I refer to this as the “Don’t make me think” approach, which pairs nicely with &#8220;Just because you can, doesn’t mean you should&#8221;&#8230;</p>

<p>In most cases, clients spend most of their time adding/editing content in the editor. It is then important to keep things simple yet provide as much functionality as possible. If your clients or users are anything like mine, more than likely they don’t spend the vast majority of their time cleaning code in their favorite text editor and are probably not catching up on their RSS feed full of their favorite web related sites just before they go to bed at 2 am like the rest of us. Clients also get confused when they hear “It’s as simple as adding a class to the element” when trying to create the desired green glossy web 2.0 button. Usually this will lead you to a variety of blank stares as their idea of a class and elements is a room of kids and the periodic table.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/an-alternative-to-the-shortcode-madness-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Linux Commands</title>
		<link>http://cappelendesign.no/2012/02/introduction-to-linux-commands/</link>
		<comments>http://cappelendesign.no/2012/02/introduction-to-linux-commands/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 11:15:19 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Interesting Reading]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=3662</guid>
		<description><![CDATA[All web developers need to work with a web server, and it&#8217;s then necessary to know a few Linux commands. If you&#8217;re not all too familiar with the Linux OS, this is a must-read. This post goes through basic Linux commands and gets more advanced without becoming to confusing. At the heart of every modern [...]]]></description>
			<content:encoded><![CDATA[<img src="http://cappelendesign.no/wp-content/uploads/2012/01/linusque.jpg-150x150.png" alt="" title="Linus" width="150" height="150" class="alignright size-thumbnail wp-image-3745" />
<p>All web developers need to work with a web server, and it&#8217;s then necessary to know a few Linux commands. If you&#8217;re not all too familiar with the Linux OS, this is a must-read. This post goes through basic Linux commands and gets more advanced without becoming to confusing.</p>
<div class="external-piece">
<p>At the heart of every modern Mac and Linux computer is the “terminal.” The terminal evolved from the text-based computer terminals of the 1960s and ’70s, which themselves replaced punch cards as the main way to interact with a computer. It’s also known as the command shell, or simply “shell.” Windows has one, too, but it’s called the “command prompt” and is descended from the MS-DOS of the 1980s.</p>

<p>Mac, Linux and Windows computers today are mainly controlled through user-friendly feature-rich graphical user interfaces (GUIs), with menus, scroll bars and drag-and-drop interfaces. But all of the basic stuff can still be accomplished by typing text commands into the terminal or command prompt.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/introduction-to-linux-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cappelen Art &amp; Design site launched, takes over AcornArtwork</title>
		<link>http://cappelendesign.no/2012/02/cappelen-art-and-design-site-launched-takes-over-acornartwork/</link>
		<comments>http://cappelendesign.no/2012/02/cappelen-art-and-design-site-launched-takes-over-acornartwork/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 13:00:24 +0000</pubDate>
		<dc:creator>Ann Christin Cappelen</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://cappelendesign.no/?p=3547</guid>
		<description><![CDATA[Welcome to Cappelen Art &#038; Design&#8217;s website for the sole proprietorship business created in 2011 by Ann Christin Cappelen. As this site launches, another site is meeting its end and is moving in here. As it got complicated and a little pointless to keep two separate portfolio sites, one for the freelance work I do [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to Cappelen Art &#038; Design&#8217;s website for the sole proprietorship business created in 2011 by Ann Christin Cappelen. As this site launches, another site is meeting its end and is moving in here.</p>

<div class="wp-caption alignright" style="margin-top:5px;"><img title="Bye bye AcornArtwork" src="http://www.cappelendesign.no/wp-content/uploads/misc/acornartwork-cappelendesign.png" alt="" /></div>

<p>As it got complicated and a little pointless to keep two separate portfolio sites, one for the freelance work I do in my business and one for anything else, I decided to combine it all together in one place. That means farewell to my old portfolio site, AcornArtwork. And what&#8217;s better than taking this merge as a challenge to write a customized theme for and using the great <a href="http://www.wordpress.org" title="Wordpress.org" target="_blank">WordPress</a> CMS which does everything I want and need for a business and portfolio site?

<p>All AcornArtwork&#8217;s blog posts have been transferred into Cappelen Art &#038; Design&#8217;s blog, and I hope to post more often. Be it a link to an another site&#8217;s post about something awesome, or the occasional self-written WordPress tutorial.</p>]]></content:encoded>
			<wfw:commentRss>http://cappelendesign.no/2012/02/cappelen-art-and-design-site-launched-takes-over-acornartwork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

