<?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>WebDesign &#38; Such &#187; Code Snippets</title>
	<atom:link href="http://webdesignandsuch.com/category/code-snippets/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdesignandsuch.com</link>
	<description>a Beantown Design Production</description>
	<lastBuildDate>Thu, 29 Jul 2010 00:02:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create a .htaccess file to redirect to a 404.html page</title>
		<link>http://webdesignandsuch.com/2010/06/create-a-htaccess-file-to-redirect-to-a-404-html-page/</link>
		<comments>http://webdesignandsuch.com/2010/06/create-a-htaccess-file-to-redirect-to-a-404-html-page/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 13:45:29 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=882</guid>
		<description><![CDATA[
			
				
			
		

A 404 error is what happens when you try to access a page on a website that doesn&#8217;t exist. We&#8217;ve all gotten them; due to typos, a moved file, whatever the case. As designers / developers we need to make sure we help the users of our websites should this happen to them. The last [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fcreate-a-htaccess-file-to-redirect-to-a-404-html-page%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fcreate-a-htaccess-file-to-redirect-to-a-404-html-page%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/posts/404/404.jpg" title="htaccess page" class="alignnone" width="422" height="227" style="border:3px solid #b96d04; margin:0 0 15px 0"/></p>
<p>A 404 error is what happens when you try to access a page on a website that doesn&#8217;t exist. We&#8217;ve all gotten them; due to typos, a moved file, whatever the case. As designers / developers we need to make sure we help the users of our websites should this happen to them. The last thing we want is for them to get an ugly 404 error, get discouraged, and exit your website.</p>
<p>Instead, you want to create a custom 404 webpage, and redirect the user to this page should the error happen to them. This is done by uploading a .htaccess page to the root of your website.<br />
<span id="more-882"></span><br />
Simply create a text document named htaccess in any text editor, and copy past the following code.</p>
<div class="codeBox">&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
ErrorDocument 404 /404.html<br />
&lt;/IfModule&gt;</div>
<p>What that code is doing is redirecting the user to 404.html. Obviously you can name the page anything, just make sure to change the code. Upload the file, put a dot in font of the name ( so it&#8217;s <strong>.htaccess</strong> ), and you&#8217;re all set. Go to your site and type in a page that you know doesn&#8217;t exist. You should be re-directed to your new 404.html page.</p>
<p>Speaking of your new 404.html page, make sure when you create it you help the user along. Check out the 404 page I made for my website, BeantownDesign.com </p>
<p><a class="demo-link" href="http://beantowndesign.com/404.html">Beantown Design 404.html page</a></p>
<p>You can see it&#8217;s rather simple, but I point the user to the three things I consider to be the most important on my site: my home page, my portfolio, and of course my contact page. You can do whatever you want, just make sure you are making your user&#8217;s life easier.</p>
<p><strong>Here is a htaccess file you can download and use.</strong></p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/404/htaccess.zip">Download File</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/create-a-htaccess-file-to-redirect-to-a-404-html-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to test if your server supports / is running PHP.</title>
		<link>http://webdesignandsuch.com/2010/06/how-to-test-if-your-browser-supports-is-running-php/</link>
		<comments>http://webdesignandsuch.com/2010/06/how-to-test-if-your-browser-supports-is-running-php/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 12:45:02 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=805</guid>
		<description><![CDATA[
			
				
			
		


If you&#8217;re going to use PHP on a website the server needs to be running PHP right? Well duuh! If you work on a variety of websites for a lot of clients, you&#8217;re going to deal with different hosts and servers. Before you hook up a form to PHP or whatever else you are planning [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fhow-to-test-if-your-browser-supports-is-running-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fhow-to-test-if-your-browser-supports-is-running-php%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #d398ac; margin: 0 0 15px 0;" title="How to test a server for PHP" src="http://webdesignandsuch.com/posts/test-php/php-test.jpg" alt="" width="422" height="227" /></p>
<p>
If you&#8217;re going to use PHP on a website the server needs to be running PHP right? Well duuh! If you work on a variety of websites for a lot of clients, you&#8217;re going to deal with different hosts and servers. Before you hook up a form to PHP or whatever else you are planning on doing, you better make sure the server can run PHP if it isn&#8217;t.</p>
<p>
The quickest way to test servers for PHP is to create a testing PHP file that you can upload to a clients website to see if PHP is running. The good thing about this is you can reuse it for every site. You simply upload this to the server, and try to open it in your web browser. If it works, you&#8217;ll see an html page with the info about the PHP running on the server. If it isn&#8217;t running PHP, well you won&#8217;t see anything!</p>
<p>
Keep reading for the code to make your own. I also provide mine as a download to save you time.</p>
<p><span id="more-805"></span></p>
<p>
If you want to create your own, just create a document called <strong>info.php</strong>. Within this file paste the following text:
</p>
<div class="codeBox">&lt;?php<br />
phpinfo();<br />
?&gt;</div>
<p>Once you upload that, try to open it in your browser. If it works, it&#8217;ll show the info about the PHP running on the server. If it doesn&#8217;t work&#8230;well you better call the host.
<p>Speaking of hosts, <a href="http://www.BlueHost.Com/track/beantowndesign/hosting-ad">here&#8217;s the host I recommend to all my clients</a>, and use for all of my personal websites, including <a href="http://www.webdesignandsuch.com">WebDesignAndSuch.com</a> and <a href="http://www.beantowndesign.com">BeantownDesign.com</a></p>
<p>Anyway, back to the PHP topic, here is a info.php file like I mentioned above. Figured I&#8217;d save you some time. Happy coding!</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/test-php/info.php.zip">Download info.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/how-to-test-if-your-browser-supports-is-running-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Set the jQuery Moving Boxes Slider to Autoplay</title>
		<link>http://webdesignandsuch.com/2010/06/set-the-jquery-moving-boxes-slider-to-autoplay/</link>
		<comments>http://webdesignandsuch.com/2010/06/set-the-jquery-moving-boxes-slider-to-autoplay/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 16:45:58 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Slider]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=801</guid>
		<description><![CDATA[
			
				
			
		

I was making a product slider for a clients website; and was using the CSS-Tricks Moving Boxes slider. I chose this slider because it had an effect that most other jQuery sliders don&#8217;t have, the main image is larger than the images leaving or entering the screen.
The one problem I found with it was that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fset-the-jquery-moving-boxes-slider-to-autoplay%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fset-the-jquery-moving-boxes-slider-to-autoplay%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #ddd; margin: 0 0 15px 0;" title="autoplay moving boxes slider" src="http://webdesignandsuch.com/posts/autoplay-movingboxes/moving.jpg" alt="" width="422" height="211" /></p>
<p>I was making a product slider for a clients website; and was using the <a href="http://css-tricks.com/moving-boxes/">CSS-Tricks Moving Boxes slider</a>. I chose this slider because it had an effect that most other jQuery sliders don&#8217;t have, the main image is larger than the images leaving or entering the screen.</p>
<p>The one problem I found with it was that there is no setting for autoplay, so the user always needs to manually press the arrow to navigate to the next photo. I wanted it to autoplay, so it starts to play as soon as you load the webpage. I found the code to make this work however, check out the demo to see the slider autoplay, and keep reading for the code / instructions.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/autoplay-movingboxes/MovingBoxes/">View Demo</a><br />
<span id="more-801"></span><br />
All you need to do to set the Moving Boxes jQuery slider to autoplay is add the following code right after line 110 in the <strong>slider.js</strong> file:</p>
<div class="codeBox">setInterval( function(){<br />
if (curPanel == totalPanels)<br />
{</p>
<p>}<br />
else<br />
{<br />
$(&#39;.right&#39;).click();<br />
}<br />
} ,6000 );</p></div>
<p>So the above code goes right after the line:<strong> $(&#8220;.left&#8221;).click(function(){ change(false); });</strong> </p>
<p>Change the number to adjust the time of delay, and it will autoplay all the way to the end of the slider.</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/set-the-jquery-moving-boxes-slider-to-autoplay/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make the words in a Form Input disappear or be selected on click / focus.</title>
		<link>http://webdesignandsuch.com/2010/06/make-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus/</link>
		<comments>http://webdesignandsuch.com/2010/06/make-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 10:39:27 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[form select]]></category>
		<category><![CDATA[Form Styling]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=774</guid>
		<description><![CDATA[
			
				
			
		

Recently I was creating a contact form for a client&#8217;s website. Due to the fact that the form was in a rather small area, I didn&#8217;t have very much room for the text and inputs. See my solution below.
Usually I would write the name of the input followed by the input like this:
First Name:

Since I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fmake-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fmake-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/posts/clear-input/input-clear.jpg" title="clear a from input on select" class="alignnone" width="422" height="211" style="border:3px solid #000; margin:0 0 15px 0"/></p>
<p>Recently I was creating a contact form for a client&#8217;s website. Due to the fact that the form was in a rather small area, I didn&#8217;t have very much room for the text and inputs. See my solution below.</p>
<p>Usually I would write the name of the input followed by the input like this:</p>
<p style="color: #333; margin-bottom: 0px;"><strong>First Name:</strong></p>
<input style="background-color: #c3effc;" type="text" />
<p>Since I didn&#8217;t have room for that I had to come up with a solution.</p>
<p><span id="more-774"></span></p>
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">The first thing I thought was to add the name of the field as a <strong>value:</strong></p>
<input style="background-color: #c3effc;" type="text" value="First Name:" />
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">What I don&#8217;t like about that solution is that the user has to select the text manually, delete it, and then fill out the field. I wanted the text to disappear when the user clicked into the input. I looked around and figured it out; here&#8217;s how it looks / works finished:</p>
<input onfocus="this.value=''" style="background-color: #c3effc;" type="text" value="First Name:" />
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">All you need to do is add <strong>onfocus=&#34;this.value=&#39;&#39;&#34;</strong> to your input. So the code for this input looks like this:</p>
<div class="codeBox"><code>&lt;input onfocus="this.value=''" type="text" value="First Name:"  /&gt;</code></div>
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">Here&#8217;s one other similar technique that might come in handy. The following input selects the text on input, instead of clearing it.</p>
<input onfocus="this.select()" type="text" value="This text will be selected on click" style="background-color: #c3effc;"/>
<p>Here&#8217;s the code for that technique:</p>
<div class="codeBox">&lt;input onfocus=&#34;this.select()&#34; type=&#34;text&#34; value=&#34;write text here&#34; /&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/make-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to refresh / reload a webpage with jQuery</title>
		<link>http://webdesignandsuch.com/2010/06/how-to-refresh-reload-a-webpage-with-jquery/</link>
		<comments>http://webdesignandsuch.com/2010/06/how-to-refresh-reload-a-webpage-with-jquery/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 02:01:21 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=764</guid>
		<description><![CDATA[
			
				
			
		

I was coding a page the other day and needed to have a button that could refresh the webpage when pressed. Turns out jQuery can take care of this rather easily. Check out the demo below, and keep reading for the code.
View Demo

First hook your page to jQuery in the head of your page.
&#60;script type=&#34;text/javascript&#34; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fhow-to-refresh-reload-a-webpage-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fhow-to-refresh-reload-a-webpage-with-jquery%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #0f67a1; margin: 0 0 15px 0;" title="jQuery web page refresh" src="http://webdesignandsuch.com/posts/jquery-page-refresh/refresh-jquery.jpg" alt="jQuery web page refresh" width="422" height="211" /></p>
<p>I was coding a page the other day and needed to have a button that could refresh the webpage when pressed. Turns out jQuery can take care of this rather easily. Check out the demo below, and keep reading for the code.</p>
<p><a class="demo-link" href="http://www.webdesignandsuch.com/posts/jquery-page-refresh/index.html">View Demo</a><br />
<span id="more-764"></span><br />
First hook your page to jQuery in the head of your page.</p>
<div class="codeBox">&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;</div>
<p>Then add the following code below that (still in the head of your document).</p>
<div class="codeBox">&lt;script type=&quot;text/javascript&quot;&gt;<br />
$(document).ready(function() {<br />
$(&#39;#resetButton&#39;).click(function() {<br />
location.reload();<br />
});<br />
});<br />
&lt;/script&gt;</div>
<p>Hook your button up with the same id that you have in the above code.</p>
<div class="codeBox">&lt;img src=&quot;button.jpg&quot; id=&quot;resetButton&quot; /&gt;</div>
<p>That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/how-to-refresh-reload-a-webpage-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set a YouTube video to Autoplay</title>
		<link>http://webdesignandsuch.com/2010/04/how-to-set-a-youtube-to-autoplay/</link>
		<comments>http://webdesignandsuch.com/2010/04/how-to-set-a-youtube-to-autoplay/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 23:08:56 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[YouTube Autoplay]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=755</guid>
		<description><![CDATA[
			
				
			
		

So you know how to embed a YouTube video onto your site right? Well good for you! Copy and paste the code YouTube gives you, easy enough. But what if you want to set the video to autoplay? What I mean by that is have it start playing as soon as the user opens your [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F04%2Fhow-to-set-a-youtube-to-autoplay%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F04%2Fhow-to-set-a-youtube-to-autoplay%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #8d8985; margin: 0 0 15px 0;" title="YouTube Logo" src="http://webdesignandsuch.com/posts/youtube-autoplay/youtube-logo.jpg" alt="" width="422" height="211" /></p>
<p>So you know how to embed a YouTube video onto your site right? Well good for you! Copy and paste the code YouTube gives you, easy enough. But what if you want to set the video to <strong>autoplay</strong>? What I mean by that is have it start playing as soon as the user opens your webpage. By default the user would need to click <strong>Play</strong> on the video to start the play cycle. It&#8217;s easy enough to set the video to autoplay however, check out the demo and keep reading for the code.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/youtube-autoplay/">View Demo</a><br />
<span id="more-755"></span><br />
So all you need to do to set the video to autoplay is add the following:</p>
<div class="codeBox">&amp;autoplay=1</div>
<p>Right at the end of the two URLs in the embed code that you copied from Youtube. So in the demo above, this was the original code:</p>
<div class="codeBox">&lt;object width=&#8221;480&#8243; height=&#8221;385&#8243;&gt;&lt;param name=&#8221;movie&#8221; value=&#8221;http://www.youtube.com/v/SlTvSUCCqPo&amp;hl=en_US&amp;fs=1&amp;rel=0&#8243;&gt;&lt;/param&gt;&lt;param name=&#8221;allowFullScreen&#8221; value=&#8221;true&#8221;&gt;&lt;/param&gt;&lt;param name=&#8221;allowscriptaccess&#8221; value=&#8221;always&#8221;&gt;&lt;/param&gt;&lt;embed src=&#8221;http://www.youtube.com/v/SlTvSUCCqPo&amp;hl=en_US&amp;fs=1&amp;rel=0&#8243; type=&#8221;application/x-shockwave-flash&#8221; allowscriptaccess=&#8221;always&#8221; allowfullscreen=&#8221;true&#8221; width=&#8221;480&#8243; height=&#8221;385&#8243;&gt;&lt;/embed&gt;&lt;/object&gt;</div>
<p>After I added the above code to the end of the URLs the embed code looked like this:</p>
<div class="codeBox">&lt;object width=&#8221;480&#8243; height=&#8221;385&#8243;&gt;&lt;param name=&#8221;movie&#8221; value=&#8221;http://www.youtube.com/v/SlTvSUCCqPo&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;autoplay=1&#8243;&gt;&lt;/param&gt;&lt;param name=&#8221;allowFullScreen&#8221; value=&#8221;true&#8221;&gt;&lt;/param&gt;&lt;param name=&#8221;allowscriptaccess&#8221; value=&#8221;always&#8221;&gt;&lt;/param&gt;&lt;embed src=&#8221;http://www.youtube.com/v/SlTvSUCCqPo&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;autoplay=1&#8243; type=&#8221;application/x-shockwave-flash&#8221; allowscriptaccess=&#8221;always&#8221; allowfullscreen=&#8221;true&#8221; width=&#8221;480&#8243; height=&#8221;385&#8243;&gt;&lt;/embed&gt;&lt;/object&gt;</div>
<p><strong>And now the video will autoplay as soon as somebody opens the webpage.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/04/how-to-set-a-youtube-to-autoplay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choose your State and Choose your Country form dropdown Select Snippets</title>
		<link>http://webdesignandsuch.com/2010/03/choose-your-state-and-choose-your-country-form-dropdown-select-snippets/</link>
		<comments>http://webdesignandsuch.com/2010/03/choose-your-state-and-choose-your-country-form-dropdown-select-snippets/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 22:20:24 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[form select]]></category>
		<category><![CDATA[form snippets]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=740</guid>
		<description><![CDATA[
			
				
			
		

I was laying out a form the other day and needed to have a drop down selection to choose your state, and another to choose your country. A very common thing on forms, but I didn&#8217;t have the code for this anywhere. So I decided to put it online for anyone else that needs this.
Here [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F03%2Fchoose-your-state-and-choose-your-country-form-dropdown-select-snippets%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F03%2Fchoose-your-state-and-choose-your-country-form-dropdown-select-snippets%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #ddd; margin: 0 0 15px 0;" title="http://webdesignandsuch.com/imagesForPosts/world-map.jpg" src="http://webdesignandsuch.com/imagesForPosts/world-map.jpg" alt="World Map" width="422" height="211" /><br />
I was laying out a form the other day and needed to have a drop down selection to choose your state, and another to choose your country. A very common thing on forms, but I didn&#8217;t have the code for this anywhere. So I decided to put it online for anyone else that needs this.</p>
<p>Here are the examples of the form dropdowns, keep reading for the code to create this in your form.</p>
<select id="state" style="margin-right: 15px; width: 180px;" name="state"> <option> Select State</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select>
<select id="country" style="width: 160px;" name="country" size="1"> <option>Select Country</option> <option value="US">United States</option> <option value="CA">Canada</option> <option>&#8212;&#8212;&#8212;-</option> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <option value="AS">American Samoa</option> <option value="AD">Andorra</option> <option value="AO">Angola</option> <option value="AI">Anguilla</option> <option value="AQ">Antarctica</option> <option value="AG">Antigua and Barbuda</option> <option value="AR">Argentina</option> <option value="AM">Armenia</option> <option value="AW">Aruba</option> <option value="AU">Australia</option> <option value="AT">Austria</option> <option value="AZ">Azerbaidjan</option> <option value="BS">Bahamas</option> <option value="BH">Bahrain</option> <option value="BD">Bangladesh</option> <option value="BB">Barbados</option> <option value="BY">Belarus</option> <option value="BE">Belgium</option> <option value="BZ">Belize</option> <option value="BJ">Benin</option> <option value="BM">Bermuda</option> <option value="BT">Bhutan</option> <option value="BO">Bolivia</option> <option value="BA">Bosnia-Herzegovina</option> <option value="BW">Botswana</option> <option value="BV">Bouvet Island</option> <option value="BR">Brazil</option> <option value="IO">British Indian Ocean Territory</option> <option value="BN">Brunei Darussalam</option> <option value="BG">Bulgaria</option> <option value="BF">Burkina Faso</option> <option value="BI">Burundi</option> <option value="KH">Cambodia</option> <option value="CM">Cameroon</option> <option value="CV">Cape Verde</option> <option value="KY">Cayman Islands</option> <option value="CF">Central African Republic</option> <option value="TD">Chad</option> <option value="CL">Chile</option> <option value="CN">China</option> <option value="CX">Christmas Island</option> <option value="CC">Cocos (Keeling) Islands</option> <option value="CO">Colombia</option> <option value="KM">Comoros</option> <option value="CG">Congo</option> <option value="CK">Cook Islands</option> <option value="CR">Costa Rica</option> <option value="HR">Croatia</option> <option value="CU">Cuba</option> <option value="CY">Cyprus</option> <option value="CZ">Czech Republic</option> <option value="DK">Denmark</option> <option value="DJ">Djibouti</option> <option value="DM">Dominica</option> <option value="DO">Dominican Republic</option> <option value="TP">East Timor</option> <option value="EC">Ecuador</option> <option value="EG">Egypt</option> <option value="SV">El Salvador</option> <option value="GQ">Equatorial Guinea</option> <option value="ER">Eritrea</option> <option value="EE">Estonia</option> <option value="ET">Ethiopia</option> <option value="FK">Falkland Islands</option> <option value="FO">Faroe Islands</option> <option value="FJ">Fiji</option> <option value="FI">Finland</option> <option value="CS">Former Czechoslovakia</option> <option value="SU">Former USSR</option> <option value="FR">France</option> <option value="FX">France (European Territory)</option> <option value="GF">French Guyana</option> <option value="TF">French Southern Territories</option> <option value="GA">Gabon</option> <option value="GM">Gambia</option> <option value="GE">Georgia</option> <option value="DE">Germany</option> <option value="GH">Ghana</option> <option value="GI">Gibraltar</option> <option value="GB">Great Britain</option> <option value="GR">Greece</option> <option value="GL">Greenland</option> <option value="GD">Grenada</option> <option value="GP">Guadeloupe (French)</option> <option value="GU">Guam (USA)</option> <option value="GT">Guatemala</option> <option value="GN">Guinea</option> <option value="GW">Guinea Bissau</option> <option value="GY">Guyana</option> <option value="HT">Haiti</option> <option value="HM">Heard and McDonald Islands</option> <option value="HN">Honduras</option> <option value="HK">Hong Kong</option> <option value="HU">Hungary</option> <option value="IS">Iceland</option> <option value="IN">India</option> <option value="ID">Indonesia</option> <option value="INT">International</option> <option value="IR">Iran</option> <option value="IQ">Iraq</option> <option value="IE">Ireland</option> <option value="IL">Israel</option> <option value="IT">Italy</option> <option value="CI">Ivory Coast (Cote D&#8217;Ivoire)</option> <option value="JM">Jamaica</option> <option value="JP">Japan</option> <option value="JO">Jordan</option> <option value="KZ">Kazakhstan</option> <option value="KE">Kenya</option> <option value="KI">Kiribati</option> <option value="KW">Kuwait</option> <option value="KG">Kyrgyzstan</option> <option value="LA">Laos</option> <option value="LV">Latvia</option> <option value="LB">Lebanon</option> <option value="LS">Lesotho</option> <option value="LR">Liberia</option> <option value="LY">Libya</option> <option value="LI">Liechtenstein</option> <option value="LT">Lithuania</option> <option value="LU">Luxembourg</option> <option value="MO">Macau</option> <option value="MK">Macedonia</option> <option value="MG">Madagascar</option> <option value="MW">Malawi</option> <option value="MY">Malaysia</option> <option value="MV">Maldives</option> <option value="ML">Mali</option> <option value="MT">Malta</option> <option value="MH">Marshall Islands</option> <option value="MQ">Martinique (French)</option> <option value="MR">Mauritania</option> <option value="MU">Mauritius</option> <option value="YT">Mayotte</option> <option value="MX">Mexico</option> <option value="FM">Micronesia</option> <option value="MD">Moldavia</option> <option value="MC">Monaco</option> <option value="MN">Mongolia</option> <option value="MS">Montserrat</option> <option value="MA">Morocco</option> <option value="MZ">Mozambique</option> <option value="MM">Myanmar</option> <option value="NA">Namibia</option> <option value="NR">Nauru</option> <option value="NP">Nepal</option> <option value="NL">Netherlands</option> <option value="AN">Netherlands Antilles</option> <option value="NT">Neutral Zone</option> <option value="NC">New Caledonia (French)</option> <option value="NZ">New Zealand</option> <option value="NI">Nicaragua</option> <option value="NE">Niger</option> <option value="NG">Nigeria</option> <option value="NU">Niue</option> <option value="NF">Norfolk Island</option> <option value="KP">North Korea</option> <option value="MP">Northern Mariana Islands</option> <option value="NO">Norway</option> <option value="OM">Oman</option> <option value="PK">Pakistan</option> <option value="PW">Palau</option> <option value="PA">Panama</option> <option value="PG">Papua New Guinea</option> <option value="PY">Paraguay</option> <option value="PE">Peru</option> <option value="PH">Philippines</option> <option value="PN">Pitcairn Island</option> <option value="PL">Poland</option> <option value="PF">Polynesia (French)</option> <option value="PT">Portugal</option> <option value="PR">Puerto Rico</option> <option value="QA">Qatar</option> <option value="RE">Reunion (French)</option> <option value="RO">Romania</option> <option value="RU">Russian Federation</option> <option value="RW">Rwanda</option> <option value="GS">S. Georgia &amp; S. Sandwich Isls.</option> <option value="SH">Saint Helena</option> <option value="KN">Saint Kitts &amp; Nevis Anguilla</option> <option value="LC">Saint Lucia</option> <option value="PM">Saint Pierre and Miquelon</option> <option value="ST">Saint Tome (Sao Tome) and Principe</option> <option value="VC">Saint Vincent &amp; Grenadines</option> <option value="WS">Samoa</option> <option value="SM">San Marino</option> <option value="SA">Saudi Arabia</option> <option value="SN">Senegal</option> <option value="SC">Seychelles</option> <option value="SL">Sierra Leone</option> <option value="SG">Singapore</option> <option value="SK">Slovak Republic</option> <option value="SI">Slovenia</option> <option value="SB">Solomon Islands</option> <option value="SO">Somalia</option> <option value="ZA">South Africa</option> <option value="KR">South Korea</option> <option value="ES">Spain</option> <option value="LK">Sri Lanka</option> <option value="SD">Sudan</option> <option value="SR">Suriname</option> <option value="SJ">Svalbard and Jan Mayen Islands</option> <option value="SZ">Swaziland</option> <option value="SE">Sweden</option> <option value="CH">Switzerland</option> <option value="SY">Syria</option> <option value="TJ">Tadjikistan</option> <option value="TW">Taiwan</option> <option value="TZ">Tanzania</option> <option value="TH">Thailand</option> <option value="TG">Togo</option> <option value="TK">Tokelau</option> <option value="TO">Tonga</option> <option value="TT">Trinidad and Tobago</option> <option value="TN">Tunisia</option> <option value="TR">Turkey</option> <option value="TM">Turkmenistan</option> <option value="TC">Turks and Caicos Islands</option> <option value="TV">Tuvalu</option> <option value="UG">Uganda</option> <option value="UA">Ukraine</option> <option value="AE">United Arab Emirates</option> <option value="GB">United Kingdom</option> <option value="UY">Uruguay</option> <option value="MIL">USA Military</option> <option value="UM">USA Minor Outlying Islands</option> <option value="UZ">Uzbekistan</option> <option value="VU">Vanuatu</option> <option value="VA">Vatican City State</option> <option value="VE">Venezuela</option> <option value="VN">Vietnam</option> <option value="VG">Virgin Islands (British)</option> <option value="VI">Virgin Islands (USA)</option> <option value="WF">Wallis and Futuna Islands</option> <option value="EH">Western Sahara</option> <option value="YE">Yemen</option> <option value="YU">Yugoslavia</option> <option value="ZR">Zaire</option> <option value="ZM">Zambia</option> <option value="ZW">Zimbabwe</option> </select>
<p><span id="more-740"></span><br />
The following is the code to create the <strong>State</strong> dropdown select in your form.</p>
<div class="codeBox">
<pre id="line211">&lt;select id="state" name="state"&gt;
  &lt;option value=""&gt;Select State&lt;/option&gt;
  &lt;option value="AL"&gt;Alabama&lt;/option&gt;
  &lt;option value="AK"&gt;Alaska&lt;/option&gt;
</pre>
<pre id="line219">  &lt;option value="AZ"&gt;Arizona&lt;/option&gt;
  &lt;option value="AR"&gt;Arkansas&lt;/option&gt;
  &lt;option value="CA"&gt;California&lt;/option&gt;
  &lt;option value="CO"&gt;Colorado&lt;/option&gt;
  &lt;option value="CT"&gt;Connecticut&lt;/option&gt;
  &lt;option value="DE"&gt;Delaware&lt;/option&gt;
</pre>
<pre id="line225">  &lt;option value="FL"&gt;Florida&lt;/option&gt;
  &lt;option value="GA"&gt;Georgia&lt;/option&gt;
  &lt;option value="HI"&gt;Hawaii&lt;/option&gt;
  &lt;option value="ID"&gt;Idaho&lt;/option&gt;
  &lt;option value="IL"&gt;Illinois&lt;/option&gt;
  &lt;option value="IN"&gt;Indiana&lt;/option&gt;
</pre>
<pre id="line231">  &lt;option value="IA"&gt;Iowa&lt;/option&gt;
  &lt;option value="KS"&gt;Kansas&lt;/option&gt;
  &lt;option value="KY"&gt;Kentucky&lt;/option&gt;
  &lt;option value="LA"&gt;Louisiana&lt;/option&gt;
  &lt;option value="ME"&gt;Maine&lt;/option&gt;
  &lt;option value="MD"&gt;Maryland&lt;/option&gt;
</pre>
<pre id="line237">  &lt;option value="MA"&gt;Massachusetts&lt;/option&gt;
  &lt;option value="MI"&gt;Michigan&lt;/option&gt;
  &lt;option value="MN"&gt;Minnesota&lt;/option&gt;
  &lt;option value="MS"&gt;Mississippi&lt;/option&gt;
  &lt;option value="MO"&gt;Missouri&lt;/option&gt;
  &lt;option value="MT"&gt;Montana&lt;/option&gt;
</pre>
<pre id="line243">  &lt;option value="NE"&gt;Nebraska&lt;/option&gt;
  &lt;option value="NV"&gt;Nevada&lt;/option&gt;
  &lt;option value="NH"&gt;New Hampshire&lt;/option&gt;
  &lt;option value="NJ"&gt;New Jersey&lt;/option&gt;
  &lt;option value="NM"&gt;New Mexico&lt;/option&gt;
  &lt;option value="NY"&gt;New York&lt;/option&gt;
</pre>
<pre id="line249">  &lt;option value="NC"&gt;North Carolina&lt;/option&gt;
  &lt;option value="ND"&gt;North Dakota&lt;/option&gt;
  &lt;option value="OH"&gt;Ohio&lt;/option&gt;
  &lt;option value="OK"&gt;Oklahoma&lt;/option&gt;
  &lt;option value="OR"&gt;Oregon&lt;/option&gt;
  &lt;option value="PA"&gt;Pennsylvania&lt;/option&gt;
</pre>
<pre id="line255">  &lt;option value="RI"&gt;Rhode Island&lt;/option&gt;
  &lt;option value="SC"&gt;South Carolina&lt;/option&gt;
  &lt;option value="SD"&gt;South Dakota&lt;/option&gt;
  &lt;option value="TN"&gt;Tennessee&lt;/option&gt;
  &lt;option value="TX"&gt;Texas&lt;/option&gt;
  &lt;option value="UT"&gt;Utah&lt;/option&gt;
</pre>
<pre id="line261">  &lt;option value="VT"&gt;Vermont&lt;/option&gt;
  &lt;option value="VA"&gt;Virginia&lt;/option&gt;
  &lt;option value="WA"&gt;Washington&lt;/option&gt;
  &lt;option value="WV"&gt;West Virginia&lt;/option&gt;
  &lt;option value="WI"&gt;Wisconsin&lt;/option&gt;
  &lt;option value="WY"&gt;Wyoming&lt;/option&gt;
</pre>
<pre id="line267">&lt;/select&gt;
</pre>
</div>
<p>The following is the code to create the <strong>Country</strong> dropdown select in your form.</p>
<div class="codeBox">
<pre id="line267">&lt;select id="country" name="country"&gt;
  &lt;option value=""&gt;Select Country&lt;/option&gt;
  &lt;option value="US"&gt;United States&lt;/option&gt;
  &lt;option value="CA"&gt;Canada&lt;/option&gt;
</pre>
<pre id="line277">  &lt;option value=""&gt;----------&lt;/option&gt;
  &lt;option value="AF"&gt;Afghanistan&lt;/option&gt;
  &lt;option value="AL"&gt;Albania&lt;/option&gt;
  &lt;option value="DZ"&gt;Algeria&lt;/option&gt;
  &lt;option value="AS"&gt;American Samoa&lt;/option&gt;
  &lt;option value="AD"&gt;Andorra&lt;/option&gt;
</pre>
<pre id="line283">  &lt;option value="AO"&gt;Angola&lt;/option&gt;
  &lt;option value="AI"&gt;Anguilla&lt;/option&gt;
  &lt;option value="AQ"&gt;Antarctica&lt;/option&gt;
  &lt;option value="AG"&gt;Antigua and Barbuda&lt;/option&gt;
  &lt;option value="AR"&gt;Argentina&lt;/option&gt;
  &lt;option value="AM"&gt;Armenia&lt;/option&gt;
</pre>
<pre id="line289">  &lt;option value="AW"&gt;Aruba&lt;/option&gt;
  &lt;option value="AU"&gt;Australia&lt;/option&gt;
  &lt;option value="AT"&gt;Austria&lt;/option&gt;
  &lt;option value="AZ"&gt;Azerbaidjan&lt;/option&gt;
  &lt;option value="BS"&gt;Bahamas&lt;/option&gt;
  &lt;option value="BH"&gt;Bahrain&lt;/option&gt;
</pre>
<pre id="line295">  &lt;option value="BD"&gt;Bangladesh&lt;/option&gt;
  &lt;option value="BB"&gt;Barbados&lt;/option&gt;
  &lt;option value="BY"&gt;Belarus&lt;/option&gt;
  &lt;option value="BE"&gt;Belgium&lt;/option&gt;
  &lt;option value="BZ"&gt;Belize&lt;/option&gt;
  &lt;option value="BJ"&gt;Benin&lt;/option&gt;
</pre>
<pre id="line301">  &lt;option value="BM"&gt;Bermuda&lt;/option&gt;
  &lt;option value="BT"&gt;Bhutan&lt;/option&gt;
  &lt;option value="BO"&gt;Bolivia&lt;/option&gt;
  &lt;option value="BA"&gt;Bosnia-Herzegovina&lt;/option&gt;
  &lt;option value="BW"&gt;Botswana&lt;/option&gt;
  &lt;option value="BV"&gt;Bouvet Island&lt;/option&gt;
</pre>
<pre id="line307">  &lt;option value="BR"&gt;Brazil&lt;/option&gt;
  &lt;option value="IO"&gt;British Indian Ocean Territory&lt;/option&gt;
  &lt;option value="BN"&gt;Brunei Darussalam&lt;/option&gt;
  &lt;option value="BG"&gt;Bulgaria&lt;/option&gt;
  &lt;option value="BF"&gt;Burkina Faso&lt;/option&gt;
  &lt;option value="BI"&gt;Burundi&lt;/option&gt;
</pre>
<pre id="line313">  &lt;option value="KH"&gt;Cambodia&lt;/option&gt;
  &lt;option value="CM"&gt;Cameroon&lt;/option&gt;
  &lt;option value="CV"&gt;Cape Verde&lt;/option&gt;
  &lt;option value="KY"&gt;Cayman Islands&lt;/option&gt;
  &lt;option value="CF"&gt;Central African Republic&lt;/option&gt;
  &lt;option value="TD"&gt;Chad&lt;/option&gt;
</pre>
<pre id="line319">  &lt;option value="CL"&gt;Chile&lt;/option&gt;
  &lt;option value="CN"&gt;China&lt;/option&gt;
  &lt;option value="CX"&gt;Christmas Island&lt;/option&gt;
  &lt;option value="CC"&gt;Cocos (Keeling) Islands&lt;/option&gt;
  &lt;option value="CO"&gt;Colombia&lt;/option&gt;
  &lt;option value="KM"&gt;Comoros&lt;/option&gt;
</pre>
<pre id="line325">  &lt;option value="CG"&gt;Congo&lt;/option&gt;
  &lt;option value="CK"&gt;Cook Islands&lt;/option&gt;
  &lt;option value="CR"&gt;Costa Rica&lt;/option&gt;
  &lt;option value="HR"&gt;Croatia&lt;/option&gt;
  &lt;option value="CU"&gt;Cuba&lt;/option&gt;
  &lt;option value="CY"&gt;Cyprus&lt;/option&gt;
</pre>
<pre id="line331">  &lt;option value="CZ"&gt;Czech Republic&lt;/option&gt;
  &lt;option value="DK"&gt;Denmark&lt;/option&gt;
  &lt;option value="DJ"&gt;Djibouti&lt;/option&gt;
  &lt;option value="DM"&gt;Dominica&lt;/option&gt;
  &lt;option value="DO"&gt;Dominican Republic&lt;/option&gt;
  &lt;option value="TP"&gt;East Timor&lt;/option&gt;
</pre>
<pre id="line337">  &lt;option value="EC"&gt;Ecuador&lt;/option&gt;
  &lt;option value="EG"&gt;Egypt&lt;/option&gt;
  &lt;option value="SV"&gt;El Salvador&lt;/option&gt;
  &lt;option value="GQ"&gt;Equatorial Guinea&lt;/option&gt;
  &lt;option value="ER"&gt;Eritrea&lt;/option&gt;
  &lt;option value="EE"&gt;Estonia&lt;/option&gt;
</pre>
<pre id="line343">  &lt;option value="ET"&gt;Ethiopia&lt;/option&gt;
  &lt;option value="FK"&gt;Falkland Islands&lt;/option&gt;
  &lt;option value="FO"&gt;Faroe Islands&lt;/option&gt;
  &lt;option value="FJ"&gt;Fiji&lt;/option&gt;
  &lt;option value="FI"&gt;Finland&lt;/option&gt;
  &lt;option value="CS"&gt;Former Czechoslovakia&lt;/option&gt;
</pre>
<pre id="line349">  &lt;option value="SU"&gt;Former USSR&lt;/option&gt;
  &lt;option value="FR"&gt;France&lt;/option&gt;
  &lt;option value="FX"&gt;France (European Territory)&lt;/option&gt;
  &lt;option value="GF"&gt;French Guyana&lt;/option&gt;
  &lt;option value="TF"&gt;French Southern Territories&lt;/option&gt;
  &lt;option value="GA"&gt;Gabon&lt;/option&gt;
</pre>
<pre id="line355">  &lt;option value="GM"&gt;Gambia&lt;/option&gt;
  &lt;option value="GE"&gt;Georgia&lt;/option&gt;
  &lt;option value="DE"&gt;Germany&lt;/option&gt;
  &lt;option value="GH"&gt;Ghana&lt;/option&gt;
  &lt;option value="GI"&gt;Gibraltar&lt;/option&gt;
  &lt;option value="GB"&gt;Great Britain&lt;/option&gt;
</pre>
<pre id="line361">  &lt;option value="GR"&gt;Greece&lt;/option&gt;
  &lt;option value="GL"&gt;Greenland&lt;/option&gt;
  &lt;option value="GD"&gt;Grenada&lt;/option&gt;
  &lt;option value="GP"&gt;Guadeloupe (French)&lt;/option&gt;
  &lt;option value="GU"&gt;Guam (USA)&lt;/option&gt;
  &lt;option value="GT"&gt;Guatemala&lt;/option&gt;
</pre>
<pre id="line367">  &lt;option value="GN"&gt;Guinea&lt;/option&gt;
  &lt;option value="GW"&gt;Guinea Bissau&lt;/option&gt;
  &lt;option value="GY"&gt;Guyana&lt;/option&gt;
  &lt;option value="HT"&gt;Haiti&lt;/option&gt;
  &lt;option value="HM"&gt;Heard and McDonald Islands&lt;/option&gt;
  &lt;option value="HN"&gt;Honduras&lt;/option&gt;
</pre>
<pre id="line373">  &lt;option value="HK"&gt;Hong Kong&lt;/option&gt;
  &lt;option value="HU"&gt;Hungary&lt;/option&gt;
  &lt;option value="IS"&gt;Iceland&lt;/option&gt;
  &lt;option value="IN"&gt;India&lt;/option&gt;
  &lt;option value="ID"&gt;Indonesia&lt;/option&gt;
  &lt;option value="INT"&gt;International&lt;/option&gt;
</pre>
<pre id="line379">  &lt;option value="IR"&gt;Iran&lt;/option&gt;
  &lt;option value="IQ"&gt;Iraq&lt;/option&gt;
  &lt;option value="IE"&gt;Ireland&lt;/option&gt;
  &lt;option value="IL"&gt;Israel&lt;/option&gt;
  &lt;option value="IT"&gt;Italy&lt;/option&gt;
  &lt;option value="CI"&gt;Ivory Coast (Cote D&amp;#39;Ivoire)&lt;/option&gt;
</pre>
<pre id="line385">  &lt;option value="JM"&gt;Jamaica&lt;/option&gt;
  &lt;option value="JP"&gt;Japan&lt;/option&gt;
  &lt;option value="JO"&gt;Jordan&lt;/option&gt;
  &lt;option value="KZ"&gt;Kazakhstan&lt;/option&gt;
  &lt;option value="KE"&gt;Kenya&lt;/option&gt;
  &lt;option value="KI"&gt;Kiribati&lt;/option&gt;
</pre>
<pre id="line391">  &lt;option value="KW"&gt;Kuwait&lt;/option&gt;
  &lt;option value="KG"&gt;Kyrgyzstan&lt;/option&gt;
  &lt;option value="LA"&gt;Laos&lt;/option&gt;
  &lt;option value="LV"&gt;Latvia&lt;/option&gt;
  &lt;option value="LB"&gt;Lebanon&lt;/option&gt;
  &lt;option value="LS"&gt;Lesotho&lt;/option&gt;
</pre>
<pre id="line397">  &lt;option value="LR"&gt;Liberia&lt;/option&gt;
  &lt;option value="LY"&gt;Libya&lt;/option&gt;
  &lt;option value="LI"&gt;Liechtenstein&lt;/option&gt;
  &lt;option value="LT"&gt;Lithuania&lt;/option&gt;
  &lt;option value="LU"&gt;Luxembourg&lt;/option&gt;
  &lt;option value="MO"&gt;Macau&lt;/option&gt;
</pre>
<pre id="line403">  &lt;option value="MK"&gt;Macedonia&lt;/option&gt;
  &lt;option value="MG"&gt;Madagascar&lt;/option&gt;
  &lt;option value="MW"&gt;Malawi&lt;/option&gt;
  &lt;option value="MY"&gt;Malaysia&lt;/option&gt;
  &lt;option value="MV"&gt;Maldives&lt;/option&gt;
  &lt;option value="ML"&gt;Mali&lt;/option&gt;
</pre>
<pre id="line409">  &lt;option value="MT"&gt;Malta&lt;/option&gt;
  &lt;option value="MH"&gt;Marshall Islands&lt;/option&gt;
  &lt;option value="MQ"&gt;Martinique (French)&lt;/option&gt;
  &lt;option value="MR"&gt;Mauritania&lt;/option&gt;
  &lt;option value="MU"&gt;Mauritius&lt;/option&gt;
  &lt;option value="YT"&gt;Mayotte&lt;/option&gt;
</pre>
<pre id="line415">  &lt;option value="MX"&gt;Mexico&lt;/option&gt;
  &lt;option value="FM"&gt;Micronesia&lt;/option&gt;
  &lt;option value="MD"&gt;Moldavia&lt;/option&gt;
  &lt;option value="MC"&gt;Monaco&lt;/option&gt;
  &lt;option value="MN"&gt;Mongolia&lt;/option&gt;
  &lt;option value="MS"&gt;Montserrat&lt;/option&gt;
</pre>
<pre id="line421">  &lt;option value="MA"&gt;Morocco&lt;/option&gt;
  &lt;option value="MZ"&gt;Mozambique&lt;/option&gt;
  &lt;option value="MM"&gt;Myanmar&lt;/option&gt;
  &lt;option value="NA"&gt;Namibia&lt;/option&gt;
  &lt;option value="NR"&gt;Nauru&lt;/option&gt;
  &lt;option value="NP"&gt;Nepal&lt;/option&gt;
</pre>
<pre id="line427">  &lt;option value="NL"&gt;Netherlands&lt;/option&gt;
  &lt;option value="AN"&gt;Netherlands Antilles&lt;/option&gt;
  &lt;option value="NT"&gt;Neutral Zone&lt;/option&gt;
  &lt;option value="NC"&gt;New Caledonia (French)&lt;/option&gt;
  &lt;option value="NZ"&gt;New Zealand&lt;/option&gt;
  &lt;option value="NI"&gt;Nicaragua&lt;/option&gt;
</pre>
<pre id="line433">  &lt;option value="NE"&gt;Niger&lt;/option&gt;
  &lt;option value="NG"&gt;Nigeria&lt;/option&gt;
  &lt;option value="NU"&gt;Niue&lt;/option&gt;
  &lt;option value="NF"&gt;Norfolk Island&lt;/option&gt;
  &lt;option value="KP"&gt;North Korea&lt;/option&gt;
  &lt;option value="MP"&gt;Northern Mariana Islands&lt;/option&gt;
</pre>
<pre id="line439">  &lt;option value="NO"&gt;Norway&lt;/option&gt;
  &lt;option value="OM"&gt;Oman&lt;/option&gt;
  &lt;option value="PK"&gt;Pakistan&lt;/option&gt;
  &lt;option value="PW"&gt;Palau&lt;/option&gt;
  &lt;option value="PA"&gt;Panama&lt;/option&gt;
  &lt;option value="PG"&gt;Papua New Guinea&lt;/option&gt;
</pre>
<pre id="line445">  &lt;option value="PY"&gt;Paraguay&lt;/option&gt;
  &lt;option value="PE"&gt;Peru&lt;/option&gt;
  &lt;option value="PH"&gt;Philippines&lt;/option&gt;
  &lt;option value="PN"&gt;Pitcairn Island&lt;/option&gt;
  &lt;option value="PL"&gt;Poland&lt;/option&gt;
  &lt;option value="PF"&gt;Polynesia (French)&lt;/option&gt;
</pre>
<pre id="line451">  &lt;option value="PT"&gt;Portugal&lt;/option&gt;
  &lt;option value="PR"&gt;Puerto Rico&lt;/option&gt;
  &lt;option value="QA"&gt;Qatar&lt;/option&gt;
  &lt;option value="RE"&gt;Reunion (French)&lt;/option&gt;
  &lt;option value="RO"&gt;Romania&lt;/option&gt;
  &lt;option value="RU"&gt;Russian Federation&lt;/option&gt;
</pre>
<pre id="line457">  &lt;option value="RW"&gt;Rwanda&lt;/option&gt;
  &lt;option value="GS"&gt;S. Georgia &amp; S. Sandwich Isls.&lt;/option&gt;
  &lt;option value="SH"&gt;Saint Helena&lt;/option&gt;
  &lt;option value="KN"&gt;Saint Kitts &amp; Nevis Anguilla&lt;/option&gt;
  &lt;option value="LC"&gt;Saint Lucia&lt;/option&gt;
</pre>
<pre id="line462">  &lt;option value="PM"&gt;Saint Pierre and Miquelon&lt;/option&gt;
  &lt;option value="ST"&gt;Saint Tome (Sao Tome) and Principe&lt;/option&gt;
  &lt;option value="VC"&gt;Saint Vincent &amp; Grenadines&lt;/option&gt;
  &lt;option value="WS"&gt;Samoa&lt;/option&gt;
  &lt;option value="SM"&gt;San Marino&lt;/option&gt;
  &lt;option value="SA"&gt;Saudi Arabia&lt;/option&gt;
</pre>
<pre id="line468">  &lt;option value="SN"&gt;Senegal&lt;/option&gt;
  &lt;option value="SC"&gt;Seychelles&lt;/option&gt;
  &lt;option value="SL"&gt;Sierra Leone&lt;/option&gt;
  &lt;option value="SG"&gt;Singapore&lt;/option&gt;
  &lt;option value="SK"&gt;Slovak Republic&lt;/option&gt;
  &lt;option value="SI"&gt;Slovenia&lt;/option&gt;
</pre>
<pre id="line474">  &lt;option value="SB"&gt;Solomon Islands&lt;/option&gt;
  &lt;option value="SO"&gt;Somalia&lt;/option&gt;
  &lt;option value="ZA"&gt;South Africa&lt;/option&gt;
  &lt;option value="KR"&gt;South Korea&lt;/option&gt;
  &lt;option value="ES"&gt;Spain&lt;/option&gt;
  &lt;option value="LK"&gt;Sri Lanka&lt;/option&gt;
</pre>
<pre id="line480">  &lt;option value="SD"&gt;Sudan&lt;/option&gt;
  &lt;option value="SR"&gt;Suriname&lt;/option&gt;
  &lt;option value="SJ"&gt;Svalbard and Jan Mayen Islands&lt;/option&gt;
  &lt;option value="SZ"&gt;Swaziland&lt;/option&gt;
  &lt;option value="SE"&gt;Sweden&lt;/option&gt;
  &lt;option value="CH"&gt;Switzerland&lt;/option&gt;
</pre>
<pre id="line486">  &lt;option value="SY"&gt;Syria&lt;/option&gt;
  &lt;option value="TJ"&gt;Tadjikistan&lt;/option&gt;
  &lt;option value="TW"&gt;Taiwan&lt;/option&gt;
  &lt;option value="TZ"&gt;Tanzania&lt;/option&gt;
  &lt;option value="TH"&gt;Thailand&lt;/option&gt;
  &lt;option value="TG"&gt;Togo&lt;/option&gt;
</pre>
<pre id="line492">  &lt;option value="TK"&gt;Tokelau&lt;/option&gt;
  &lt;option value="TO"&gt;Tonga&lt;/option&gt;
  &lt;option value="TT"&gt;Trinidad and Tobago&lt;/option&gt;
  &lt;option value="TN"&gt;Tunisia&lt;/option&gt;
  &lt;option value="TR"&gt;Turkey&lt;/option&gt;
  &lt;option value="TM"&gt;Turkmenistan&lt;/option&gt;
</pre>
<pre id="line498">  &lt;option value="TC"&gt;Turks and Caicos Islands&lt;/option&gt;
  &lt;option value="TV"&gt;Tuvalu&lt;/option&gt;
  &lt;option value="UG"&gt;Uganda&lt;/option&gt;
  &lt;option value="UA"&gt;Ukraine&lt;/option&gt;
  &lt;option value="AE"&gt;United Arab Emirates&lt;/option&gt;
  &lt;option value="GB"&gt;United Kingdom&lt;/option&gt;
</pre>
<pre id="line504">  &lt;option value="UY"&gt;Uruguay&lt;/option&gt;
  &lt;option value="MIL"&gt;USA Military&lt;/option&gt;
  &lt;option value="UM"&gt;USA Minor Outlying Islands&lt;/option&gt;
  &lt;option value="UZ"&gt;Uzbekistan&lt;/option&gt;
  &lt;option value="VU"&gt;Vanuatu&lt;/option&gt;
  &lt;option value="VA"&gt;Vatican City State&lt;/option&gt;
</pre>
<pre id="line510">  &lt;option value="VE"&gt;Venezuela&lt;/option&gt;
  &lt;option value="VN"&gt;Vietnam&lt;/option&gt;
  &lt;option value="VG"&gt;Virgin Islands (British)&lt;/option&gt;
  &lt;option value="VI"&gt;Virgin Islands (USA)&lt;/option&gt;
  &lt;option value="WF"&gt;Wallis and Futuna Islands&lt;/option&gt;
  &lt;option value="EH"&gt;Western Sahara&lt;/option&gt;
</pre>
<pre id="line516">  &lt;option value="YE"&gt;Yemen&lt;/option&gt;
  &lt;option value="YU"&gt;Yugoslavia&lt;/option&gt;
  &lt;option value="ZR"&gt;Zaire&lt;/option&gt;
  &lt;option value="ZM"&gt;Zambia&lt;/option&gt;
  &lt;option value="ZW"&gt;Zimbabwe&lt;/option&gt;
&lt;/select&gt;
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/03/choose-your-state-and-choose-your-country-form-dropdown-select-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Target the first paragraph on a page or section with CSS</title>
		<link>http://webdesignandsuch.com/2010/02/target-the-first-paragraph-on-a-page-or-section-with-css/</link>
		<comments>http://webdesignandsuch.com/2010/02/target-the-first-paragraph-on-a-page-or-section-with-css/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 13:40:41 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Snippets]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=732</guid>
		<description><![CDATA[
			
				
			
		

So often I&#8217;ll be working on a website that somebody else coded and have to strip out junk styling. There are a lot of different ways to accomplish the same thing with CSS, but so many people have no idea how much time they are wasting by coding something in a &#8220;hacky&#8221; manner.
Example. I was [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F02%2Ftarget-the-first-paragraph-on-a-page-or-section-with-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F02%2Ftarget-the-first-paragraph-on-a-page-or-section-with-css%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #1e8acf; margin: 0 0 15px 0;" title="CSS child selector" src="http://webdesignandsuch.com/posts/css-child/para.jpg" alt="" width="422" height="211" /></p>
<p>So often I&#8217;ll be working on a website that somebody else coded and have to strip out junk styling. There are a lot of different ways to accomplish the same thing with CSS, but so many people have no idea how much time they are wasting by coding something in a &#8220;hacky&#8221; manner.</p>
<p><strong>Example.</strong><br /> I was working on a site the other day and noticed that every single paragraph in the main content area of every page of the site had a class of &#8220;first-paragraph&#8221; on it. So I looked in the external sheet and saw that this was simply to remove the top margin on the first paragraph on every page. Ok, so that method worked..great. Except that manually adding a class to every paragraph tag is such a waste of time. Check out the demo where I show an example of targeting the first paragraph in a content area without adding any classes or IDs paragraph tag in the XHTML. Then keep reading to see how to properly code the example above.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/css-child/index.html">View Demo</a><br />
<span id="more-732"></span><br />
Here is the code to put in your external CSS sheet to select the first paragraph in a section (in this example a div called &#8220;content&#8221;). In this example I remove the top margin. If the coder in my example above had done this he wouldn&#8217;t have need to add any class to the paragraph tags in the XHTML. Don&#8217;t ya just love CSS?</p>
<div class="codeBox">#content p:first-child {margin-top:0px}</div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/02/target-the-first-paragraph-on-a-page-or-section-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add an auto-updating Copyright to your website with Javascript</title>
		<link>http://webdesignandsuch.com/2010/02/add-an-auto-updating-copyright-on-your-website-with-javascript/</link>
		<comments>http://webdesignandsuch.com/2010/02/add-an-auto-updating-copyright-on-your-website-with-javascript/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 14:23:46 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Auto copyright]]></category>
		<category><![CDATA[Current Date Javascipt]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=725</guid>
		<description><![CDATA[
			
				
			
		

Websites need to have the copyrights on them. Usually this is found in the footer of the site. As I was updating a client&#8217;s site the other day I noticed his copyright info was still 2009; so I updated it in the template, applied it to the pages, and re-uploaded everything to the live site.
One [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F02%2Fadd-an-auto-updating-copyright-on-your-website-with-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F02%2Fadd-an-auto-updating-copyright-on-your-website-with-javascript%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" title="javascript-copyright" src="http://webdesignandsuch.com/posts/js-copyright/copy.gif" alt="" width="422" height="211" style="border:3px solid #ddd; margin:0 0 15px 0"/></p>
<p>Websites need to have the copyrights on them. Usually this is found in the footer of the site. As I was updating a client&#8217;s site the other day I noticed his copyright info was still 2009; so I updated it in the template, applied it to the pages, and re-uploaded everything to the live site.</p>
<p>One of the worst things you can do with your website is to not make updates once it&#8217;s live. Fresh content is the only thing that will keep your users AND search engines returning. One of the best ways to let users know that you never update your website (saaarcasm), is to have a copyright in the footer of your website from 2003. It really is a pain to have to go in at the first of every year to update all of your client&#8217;s websites though. Luckily, Javascript can save us. Using Javascript we can add a copyright to the webpage that will automatically update with the current year. Check out the demo, and then keep reading to grab the code.</p>
<p><a class="demo-link" href="http://www.webdesignandsuch.com/posts/js-copyright/index.html">View Demo</a></p>
<p><span id="more-725"></span></p>
<p>All you need to do is paste the following code right into the XHTML where you want the copyright to show up, Javascript does the rest!</p>
<div class="codeBox">&lt;p &gt;&amp;copy;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
var currentTime = new Date()<br />
var year = currentTime.getFullYear()<br />
document.write(year)<br />
&lt;/script&gt;<br />
&lt;/p&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/02/add-an-auto-updating-copyright-on-your-website-with-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create a Popup with CSS and Javascript</title>
		<link>http://webdesignandsuch.com/2009/12/how-to-create-a-popup-with-css-and-javascript/</link>
		<comments>http://webdesignandsuch.com/2009/12/how-to-create-a-popup-with-css-and-javascript/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 17:27:23 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Pop Up]]></category>
		<category><![CDATA[Popup]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=709</guid>
		<description><![CDATA[
			
				
			
		

Popups suck.
The good thing is you don&#8217;t see that many of them any more. That&#8217;s because browsers recognize that they suck and are most likely spam or ads and so they block the popups. The old way of creating a popup was to force open a new browser window over the current browser window. So [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fhow-to-create-a-popup-with-css-and-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fhow-to-create-a-popup-with-css-and-javascript%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #000; margin: 0 0 15px 0;" title="css popup" src="http://webdesignandsuch.com/posts/css-popup/pop.gif" alt="" width="422" height="211" /></p>
<h2 style="margin-bottom:20px">Popups suck.</h2>
<p>The good thing is you don&#8217;t see that many of them any more. That&#8217;s because browsers recognize that they suck and are most likely spam or ads and so they block the popups. The old way of creating a popup was to force open a new browser window over the current browser window. So this is what browsers block. But what if you actually have a need to use a popup window for something useful and not spammy? This happened to me the other day. A client wanted a popup window on their homepage to wish everyone a Merry Christmas.</p>
<p>Knowing I couldn&#8217;t use the old popup method, I went searching. I knew it&#8217;d be easy enough to use CSS to put a floating div over the content of the site, which creates a popup effect. The problem was how do you close the popup once it&#8217;s open? Javascript would be needed for this. Check out the demo I setup which shows how the <strong>CSS popup</strong> can be set to open on <strong>pageload</strong> or by <strong>clicking on a link</strong>; and then how Javascript allows you to have a &#8220;close&#8221; button that shuts or hides the popup. Then continue reading for the code and downloadable files.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/css-popup/css-popup.html">View Demo</a></p>
<p><span id="more-709"></span></p>
<p>If you check out the source code of the html file, you&#8217;ll see the following in the body. The &#8220;<strong>blanket</strong>&#8221; is the effect of putting the transparent black background behind the popup, which helps separate it from the rest of the content on the page. The &#8220;<strong>popUpDiv</strong>&#8221; is where you put the content of your popup.</p>
<div class="codeBox">&lt;div id=&#8221;blanket&#8221; style=&#8221;display:none;&#8221;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;popUpDiv&#8221; style=&#8221;display:none;&#8221;&gt;</p>
<p>&lt;a href=&#8221;#&#8221; onclick=&#8221;popup(&#8216;popUpDiv&#8217;)&#8221; &gt;Click to Close CSS Pop Up&lt;/a&gt;<br />
&lt;/div&gt;<br />
&lt;a href=&#8221;#&#8221; onclick=&#8221;popup(&#8216;popUpDiv&#8217;)&#8221;&gt;Click to Open CSS Pop Up&lt;/a&gt;</p>
</div>
<p>If you want the popup to load on <strong>page load</strong>, put the following in your body tag.</p>
<div class="codeBox">&lt;body   onload=&#8221;popup(&#8216;popUpDiv&#8217;)&#8221;&gt;</div>
<p>Here is the CSS used to style the blanket effect and the popup div. You&#8217;ll see I turned the blanket effect off for Internet Explorer, since it doesn&#8217;t appear to support &#8220;opacity&#8221; (big surprise).</p>
<div class="codeBox">#blanket {<br />
background-color:#111;<br />
opacity: 0.65;<br />
*background:none;<br />
position:absolute;<br />
z-index: 9001;<br />
top:0px;<br />
left:0px;<br />
width:100%;<br />
}</p>
<p>#popUpDiv {<br />
position:absolute;<br />
background:url(pop-back.jpg) no-repeat;<br />
width:400px;<br />
height:400px;<br />
border:5px solid #000;<br />
z-index: 9002;<br />
}</p>
</div>
<p>There is a Javacript file linked to the html file to make some of the magic happen. I&#8217;m going to make the demo files available so you can play with it and make your own. <strong>Enjoy!</strong></p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/css-popup/css-popup.zip">Download Files</a></p>
<p>One last thing.. the original code for this was <a href="http://www.pat-burt.com/web-development/how-to-do-a-css-popup-without-opening-a-new-window/">found here</a>. I made some edits to make it work for my application.</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/12/how-to-create-a-popup-with-css-and-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
