<?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>Interactive IQ : The Hessler Design Blog</title>
	<atom:link href="http://www.hesslerdesign.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hesslerdesign.com/blog</link>
	<description>Smart Developers = Smart Websites</description>
	<lastBuildDate>Fri, 20 Aug 2010 02:31:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>User Experience Lesson from Google</title>
		<link>http://www.hesslerdesign.com/blog/web-design/user-experience-lesson-from-google/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/user-experience-lesson-from-google/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 02:31:19 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=602</guid>
		<description><![CDATA[As a web guy, I like good user experiences.  I try not to make users think.  And I try to make the user experience as intuitive as I possibly can. Today, I was once again flabbergasted by a great little feature I accidentally discovered using Google&#8217;s Gmail.  It reminded me that as good as a [...]]]></description>
			<content:encoded><![CDATA[<p>As a web guy, I like good user experiences.  I try not to make users think.  And I try to make the user experience as intuitive as I possibly can.</p>
<p>Today, I was once again flabbergasted by a great little feature I accidentally discovered using Google&#8217;s Gmail.  It reminded me that as good as a user experience gets, there&#8217;s always room for improvement.</p>
<p>(It also made me think of the quote from TRON, which is applicable to web design and user experiences as well: <em>&#8220;On the other side of the screen, it all looks so easy.&#8221;</em>)</p>
<p>So what was this great little feature of Gmail?  I was typing a message and had every intention of attaching a PDF file.  Problem is, I totally forgot to attach the PDF file.  Luckily, Google was smart enough to know that I wanted to attach the file, and prompted me, asking if I wanted to attach anything.</p>
<p>&#8220;How&#8217;d they do that?&#8221; you ask?  Well, in my message, I had included the words &#8220;Attached is&#8230;&#8221;, referencing the PDF file I was going to attach and wanted the recipient to look for.  Apparently, Google thought that, like me, people would forget to attach files more than just once.  So they put in logic to search each message for certain keywords (&#8220;attached is&#8221;, in my case), and if the email has no attachments, they&#8217;ll give you a popup message that tells you they found those keywords in your message, and ask if you really want to send the email as-is, or if you want to attach a file.</p>
<p>Chalk one up for Google in teaching us all another lesson on a subtle but well thought-out user experience.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/user-experience-lesson-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build a Customized Progress Bar Using CSS and JQuery</title>
		<link>http://www.hesslerdesign.com/blog/tutorials/build-a-customized-progress-bar-using-css-and-jquery/</link>
		<comments>http://www.hesslerdesign.com/blog/tutorials/build-a-customized-progress-bar-using-css-and-jquery/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 19:30:02 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=590</guid>
		<description><![CDATA[One nice feature that many websites have is a progress bar.  They come in many shapes and sizes, whether they are showing a user what step they&#8217;re on in a process, what percent of the way through a process the user is, etc.  And today, with the use of trusted CSS and JavaScript (in the [...]]]></description>
			<content:encoded><![CDATA[<p>One nice feature that many websites have is a progress bar.  They come in many shapes and sizes, whether they are showing a user what step they&#8217;re on in a process, what percent of the way through a process the user is, etc.  And today, with the use of trusted CSS and JavaScript (in the form of the jQuery library), a progress bar has never been easier to create with a minimal amount of images needed.  (Truthfully, you don&#8217;t need any images, but in the example below the tutorial, I&#8217;ve used a few to add some nice styling to the example.)</p>
<p>With that said, on with the code!</p>
<h4>Step 1: Set Up HTML Code</h4>
<p>The first thing you want to do is to create two div tags in your file, each with unique IDs.  One will be the &#8220;container&#8221; for the progress bar, and the other will be located inside of it, and will be the one getting sized to show the progress.  Here&#8217;s how I have set it up:</p>
<p><code><span style="color: #000099;">&lt;div id=</span><span style="color: #0000ff;">"progress-bar"</span><span style="color: #000099;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;div id=</span><span style="color: #0000ff;">"status"</span><span style="color: #000099;">&gt;&lt;/div&gt;</span><br />
<span style="color: #000099;">&lt;/div&gt;</span></code></p>
<h4>Step 2: Add Some Style</h4>
<p>Now that the basic HTML is set up (and seriously, how easy was that HTML setup?), we&#8217;ll add some CSS magic to make it look better.  Here&#8217;s how I have styled our example:</p>
<p><code><span style="color: #ff00ff;">#progress-bar</span> <span style="color: #ff00ff;">{</span><span style="color: #000099;">border</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">1px solid #bebebe</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">background</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">#ffffff</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">width</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">300px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">height</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">14px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">-moz-border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">-webkit-border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">-khtml-border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span><span style="color: #ff00ff;">}</span><br />
<span style="color: #ff00ff;">#status</span> {<span style="color: #000099;">background</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">#0066cc</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">width</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">50%</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">height</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">14px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">-moz-border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">-webkit-border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">-khtml-border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span> <span style="color: #000099;">border-radius</span><span style="color: #ff00ff;">:</span><span style="color: #0000ff;">10px</span><span style="color: #ff00ff;">;</span><span style="color: #ff00ff;">}</span></code></p>
<p>The important thing to note here is that the <code>#status</code> ID has a percentage-based width.  Since it is contained within the fixed width <code>#progress-bar</code> div, it&#8217;ll automatically calculate how wide it has to be.  Oh the magic of CSS!</p>
<p>Another thing to note here is the use of the multiple &#8220;radius&#8221; attributes for different browsers.  It&#8217;s a bit out of the scope of this post, but to make a long story short, if your browser supports one of these attributes, you&#8217;ll get a nice rounded look.  If not, it&#8217;ll just be a normal rectangle.  Your call on whether you like the rounded corners or not.</p>
<p>If you decide to use the &#8220;radius&#8221; attributes for styling, be warned that if the percent width on your status bar is at or lower than the radius amount, it may throw off the look of the edges, as the browser will try to &#8220;make up&#8221; the shape with corners as best it can with the radius values included.  This isn&#8217;t a factor when the corners are squared off, but it&#8217;s a good thing to know up front, just in case you need small percentages used.</p>
<p>Also, feel free to style these with background images, with taller heights, different colors, etc.  As you&#8217;ll see in the included sample below, I&#8217;ve gone ahead and added in some background images to spice up the design a bit.</p>
<h4>3. Jazz It Up with jQuery</h4>
<p>Once your HTML and CSS are in place, you&#8217;re all done.  Unless, however, you want to update the progress bar on the spot in front of the user.  If that&#8217;s what you&#8217;re going for, then here&#8217;s where you can use some jQuery goodness to animate the bar however you need.</p>
<p>First, you&#8217;ll need the most recent version of the jQuery library.  Link it into your HTML file, and then whenever you need to change the width of the <code>#status</code> bar, just call a JavaScript function like this (with the &#8220;80%&#8221; width attribute set to whatever you need it set to):</p>
<p><code>$<span style="color: #000099;">(</span><span style="color: #0000ff;">"#status"</span><span style="color: #000099;">)</span>.animate<span style="color: #000099;">( {</span> width: <span style="color: #0000ff;">"80%"</span> <span style="color: #000099;">}</span>, <span style="color: #ff0000;">500</span><span style="color: #000099;">)</span>;</code></p>
<h4>Wrapping It Up</h4>
<p>That&#8217;s really all there is to it.  Pretty basic stuff.  But it&#8217;s definitely a nice trick to have up your sleeve.  And with a little extra work on styling and JavaScript logic, you can have some pretty robust logic that does some really cool things.  The example below shows you how the extra styling looks, and will allow you to see how the #status bar animates when the jQuery function is called.</p>
<p>Until next time, happy coding!</p>
<h4>Example</h4>
<p><iframe id="progress_bar_example" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2010/08/progress_bar/index.html" width="100%" height="190" scrolling="auto" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/tutorials/build-a-customized-progress-bar-using-css-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulletproof Your Online Forms for Mobile Devices with PHP – Part 2</title>
		<link>http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-%e2%80%93-part-2/</link>
		<comments>http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-%e2%80%93-part-2/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 16:50:54 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=566</guid>
		<description><![CDATA[In the last post, we explored how to set up an online form using HTML and PHP. In this post, we&#8217;re going to finish setting up the logic to store form field values and validate the form.  If you haven&#8217;t read the last post and want to catch up, please click here to go to [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-part-1/">last post</a>, we explored how to set up an online form using HTML and PHP.  In this post, we&#8217;re going to finish setting up the logic to store form field values and validate the form.  If you haven&#8217;t read the last post and want to catch up, please <a href="http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-part-1/" target="_self">click here to go to part 1</a>.</p>
<h4>Step 1: Add PHP Functions for Setting/Resetting Variables</h4>
<p>In the last post, we set the form up so the value for each form field is set to a corresponding PHP variable. Now we need to make sure that when the form field changes and a user action (like submitting the form) takes place, the PHP variables get set to the newly updated form field values.  This is a simple process, as we just have to create a function to set the PHP variables.  And while we&#8217;re at it, we can create another function to reset the PHP variables for our &#8216;Clear Form&#8217; button.  Here are the functions we&#8217;ll use.  Note that we need to use the &#8216;global&#8217; keyword inside the functions to access and successfully update the variables.</p>
<p><code><span style="color: #0000ff;">function</span> setVariables<span style="color: #000099;">() {</span><br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_name;<br />
&nbsp; &nbsp;$user_name <span style="color: #0000ff;">=</span> <span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">"user_name"</span><span style="color: #000099;">]</span>;<br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_email;<br />
&nbsp; &nbsp;$user_email <span style="color: #0000ff;">=</span> <span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">"user_email"</span><span style="color: #000099;">]</span>;<br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_message;<br />
&nbsp; &nbsp;$user_message <span style="color: #0000ff;">=</span> <span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">"user_message"</span><span style="color: #000099;">]</span>;<br />
<span style="color: #000099;">}</span><br />
<span style="color: #0000ff;">function</span> resetVariables<span style="color: #000099;">() {</span><br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_name;<br />
&nbsp; &nbsp;$user_name <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_email;<br />
&nbsp; &nbsp;$user_email <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_message;<br />
&nbsp; &nbsp;$user_message <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
<span style="color: #000099;">}</span></code></p>
<p>Again, these functions will eventually get called when a user clicks on the Submit or Reset button, respectively.</p>
<p><span id="more-566"></span></p>
<h4>Step 2: Add PHP Functions for Form Field Validation</h4>
<p>Now it&#8217;s time to write out the validation functions for the form.  In our example, we have three fields.  The name and message fields will be a simple character count for their validation.  In the email validation, we will use one of the well known regular expressions that will check the email value for correct syntax.</p>
<p>For the simple text input, we&#8217;ll create a function that accepts two arguments.  The first argument will be the value to get validated, and the second will be the minimum number of characters that need to be present in the first value.  Inside the function, there will be some simple conditional logic that will check the string length of the first value to the minimum number of characters.  We&#8217;ll also set a return value of &#8216;y&#8217; or &#8216;n&#8217; so we&#8217;ll know whether or not our value is valid.  Here&#8217;s what our simple text input validation function will look like:</p>
<p><code><span style="color: #0000ff;">function</span> validateTextInput<span style="color: #000099;">(</span>$str, $minLength<span style="color: #0000ff;">=</span><span style="color: #ff0000;">1</span><span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span><span style="color: #0000ff;">strlen</span><span style="color: #000099;">(</span>$str<span style="color: #000099;">)</span> <span style="color: #0000ff;">&lt;</span> $minLength<span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$lValid <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">'n'</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span> <span style="color: #006600;">else</span> <span style="color: #000099;">{</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$lValid <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">'y'</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;<span style="color: #006600;">return</span> $lValid;<br />
<span style="color: #000099;">}</span></code></p>
<p>For the email validation function, we&#8217;ll simply pass in the value to check as the one and only argument.  Inside the function, the conditional logic checks the value against the aforementioned regular expression.  And, like the text input validation function above, this one also returns a &#8216;y&#8217; or &#8216;n&#8217; value telling us whether or not the value is valid.  Here&#8217;s what our email validation function will look like:</p>
<p><code><span style="color: #0000ff;">function</span> validateEmail<span style="color: #000099;">(</span>$str<span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span><span style="color: #0000ff;">!eregi</span><span style="color: #000099;">(</span><span style="color: #cc0000;">"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"</span>, $str<span style="color: #000099;">)) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$lValid <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">'n'</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span> <span style="color: #006600;">else</span> <span style="color: #000099;">{</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$lValid <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">'y'</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;<span style="color: #006600;">return</span> $lValid;<br />
<span style="color: #000099;">}</span></code></p>
<h4>Step 3: Add PHP Function for Overall Form Validation</h4>
<p>Now that we have set up the individual form field validation functions, we&#8217;ll need a master function that will be called when the user clicks the Submit button.  It will validate all of our fields, and will hold logic to either show an error or send the form.  Here&#8217;s what the function will look like.  An explanation of the function is below the function.</p>
<p><code><span style="color: #0000ff;">function</span> validateForm<span style="color: #000099;">() {</span><br />
&nbsp; &nbsp;$default_error <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">"There was a problem with your entry. Please correct the following fields."</span>;<br />
&nbsp; &nbsp;$error <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
<br />
&nbsp; &nbsp;<span style="color: #999999;">// Set up global variables to check</span><br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_name;<br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_email;<br />
&nbsp; &nbsp;<span style="color: #006600;">global</span> $user_message;<br />
<br />
&nbsp; &nbsp;<span style="color: #999999;">// Perform validation for fields</span><br />
&nbsp; &nbsp;$valid_user_name <span style="color: #0000ff;">=</span> validateTextInput<span style="color: #000099;">(</span>$user_name, <span style="color: #ff0000;">1</span><span style="color: #000099;">)</span>;<br />
&nbsp; &nbsp;$valid_user_email <span style="color: #0000ff;">=</span> validateEmail<span style="color: #000099;">(</span>$user_email<span style="color: #000099;">)</span>;<br />
&nbsp; &nbsp;$valid_user_message <span style="color: #0000ff;">=</span> validateTextInput<span style="color: #000099;">(</span>$user_message, <span style="color: #ff0000;">5</span><span style="color: #000099;">)</span>;<br />
<br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span>$valid_user_name <span style="color: #0000ff;">!=</span> <span style="color: #cc0000;">'y'</span><span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$error <span style="color: #0000ff;">.=</span> <span style="color: #cc0000;">"&lt;li&gt;Your Name&lt;/li&gt;"</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span>$valid_user_email <span style="color: #0000ff;">!=</span> <span style="color: #cc0000;">'y'</span><span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$error <span style="color: #0000ff;">.=</span> <span style="color: #cc0000;">"&lt;li&gt;Your Email&lt;/li&gt;"</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span>$valid_user_message <span style="color: #0000ff;">!=</span> <span style="color: #cc0000;">'y'</span><span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;$error <span style="color: #0000ff;">.=</span> <span style="color: #cc0000;">"&lt;li&gt;Message&lt;/li&gt;"</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
<br />
&nbsp; &nbsp;<span style="color: #999999;">// Return error value or send form</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span>$error<span style="color: #000099;">) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;div class=\"error\"&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;label&gt;"</span> . $default_error . <span style="color: #cc0000;">"&lt;/label&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;ul&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> $error;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;/ul&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;/div&gt;"</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span> <span style="color: #006600;">else</span> <span style="color: #000099;">{</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;sendForm<span style="color: #000099;">()</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
<span style="color: #000099;">}</span></code></p>
<p>First, the function will have two variables: <code>$default_error</code> and <code>$error</code>.  As you noticed, the <code>$default_error</code> has the general text calling out that there&#8217;s an error, and the <code>$error</code> variable is blank by default.</p>
<p>Next, we set up the global variables that we need to check.</p>
<p>Third, we set up a unique variable that will be set to the return value of our individual field validation functions.  After these variables are set up, we put in conditional logic that appends the <code>$error</code> variable with <code>&lt;li&gt;</code> tags if the variable isn&#8217;t set to &#8216;y&#8217;.</p>
<p>Finally, there is conditional logic that checks the <code>$error</code> variable.  If this variable is set to anything other than its default blank value, we echo out some HTML markup that writes out our <code>$default_error</code> message, and then lists out each individual form field that is invalid.  If the variable is still blank, we call the <code>sendForm()</code> function (not included in this article &#8211; you can write that out depending on the needs of your project).</p>
<h4>Step 4: Add Markup and Logic for Submit and Reset Button Actions</h4>
<p>Now that we have everything set up, we obviously need to be able to call our validation and reset functions, based on what button the user clicks.  I am a fan of putting this logic inside of a <code>&lt;div&gt;</code> tag at the top of the form.  Since the validation function echos out a message if invalid, it will thus echo out to a div tag that we can style however we want.  Same with the reset logic, as we will first display a &#8220;are you sure you want to reset?&#8221; message with a &#8216;Yes&#8217; and &#8216;No&#8217; button.  Here&#8217;s the markup we&#8217;ll insert for this logic, that we&#8217;ll place between the opening <code>&lt;form&gt;</code> tag and the first <code>&lt;label&gt;</code>.</p>
<p><code><span style="color: #999999;">&lt;!-- Error Message --&gt;</span><br />
<span style="color: #000099;">&lt;div id=</span><span style="color: #0000ff;">"error-message"</span><span style="color: #000099;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #ff0000;">&lt;?php</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span><span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">"submit"</span><span style="color: #000099;">]) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;setVariables<span style="color: #000099;">()</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;validateForm<span style="color: #000099;">()</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;<span style="color: #ff0000;">?&gt;</span><br />
<span style="color: #000099;">&lt;/div&gt;</span></code></p>
<p><code><span style="color: #999999;">&lt;!-- Reset Confirmation Message --&gt;</span><br />
<span style="color: #000099;">&lt;div id=</span><span style="color: #0000ff;">"confirm-reset"</span><span style="color: #000099;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #ff0000;">&lt;?php</span><br />
&nbsp; &nbsp;<span style="color: #006600;">if</span> <span style="color: #000099;">(</span><span style="color: #0000ff;">isset</span><span style="color: #000099;">(</span><span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">'reset'</span><span style="color: #000099;">])) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;setVariables<span style="color: #000099;">()</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;div class=\"confirm\"&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;label&gt;Are you sure you want to reset?&lt;/label&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;div class=\"hidden\"&gt;&lt;br /&gt;&lt;/div&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;input type=\"submit\" class=\"button\" name=\"reset-yes\" value=\"Yes\" /&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;div style=\"display:inline; width:16px;\"&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;input type=\"submit\" class=\"button\" name=\"reset-no\" value=\"No\" /&gt;"</span>;<br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">echo</span> <span style="color: #cc0000;">"&lt;/div&gt;"</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span> <span style="color: #006600;">else if</span> <span style="color: #000099;">(</span><span style="color: #0000ff;">isset</span><span style="color: #000099;">(</span><span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">'reset-no'</span><span style="color: #000099;">])) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;setVariables<span style="color: #000099;">()</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span> <span style="color: #006600;">else if</span> <span style="color: #000099;">(</span><span style="color: #0000ff;">isset</span><span style="color: #000099;">(</span><span style="color: #0066ff;">$_POST</span><span style="color: #000099;">[</span><span style="color: #cc0000;">'reset-yes'</span><span style="color: #000099;">])) {</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;resetVariables<span style="color: #000099;">()</span>;<br />
&nbsp; &nbsp;<span style="color: #000099;">}</span><br />
&nbsp; &nbsp;<span style="color: #ff0000;">?&gt;</span><br />
<span style="color: #000099;">&lt;/div&gt;</span></code></p>
<p>As you see, the error message <code>&lt;div&gt;</code> tag has conditional logic that checks for <code><span style="color: #0066ff;">$_POST</span>[<span style="color: #cc0000;">"submit"</span>]</code>.  If our submit button is clicked, the two functions inside this conditional statement are fired off.  First, we call the <code>setVariables()</code> function, which as outlined above, sets all of our global PHP variables to the value of the form fields.  After we have called this function, we call our <code>validateForm()</code> function that validates each field and checks whether to display an error message or send the form.</p>
<p>The reset <code>&lt;div&gt;</code> tag is a bit more detailed.  Our form &#8216;Reset&#8217; button is set up with name &#8216;reset&#8217;, which is equivalent to <code><span style="color: #0066ff;">$_POST</span>[<span style="color: #cc0000;">'reset'</span>]</code>.  This is the first check of our conditional logic here, which calls the <code>setVariables()</code>, and echos out a <code>&lt;div&gt;</code> tag with the reset confirmation message and accompanying &#8216;Yes&#8217; and &#8216;No&#8217; buttons.</p>
<p>The second and third checks of the reset conditional logic check for the &#8216;Yes&#8217; and &#8216;No&#8217; button clicks.  If the &#8216;No&#8217; button is clicked, we simply call the <code>setVariables()</code> function.  If the &#8216;Yes&#8217; button is clicked, we call the <code>resetVariables()</code> function which as outlined above, resets all variables and therefore erases the form field values.</p>
<h4>Wrapping It Up</h4>
<p>As I mentioned at the beginning of the article, this is useful because all of the logic is done with PHP, and can thus be used on any browser and device, regardless of how the settings are configured.  What I like to do is to put all of the logic in its own file, and then include it in the page wherever I need it.  That way, if I have a completely separate set of files for full web vs. mobile, for instance, I can still use the same one file that contains the form, and style it with CSS depending on what version of the site the user is seeing.</p>
<p>Also, at this point, feel free to add in your own CSS and/or other HTML markup for how the form is set up and will be displayed.</p>
<p>Also, since there&#8217;s A LOT of code and logic here, I have gone ahead and packaged up the files in a zip file that you can download for your convenience.  The zip file includes some sample CSS styles that I have set up to customize the look of the form.</p>
<p>Until next time, happy coding!</p>
<p><a title="Download Source Files" href="http://www.hesslerdesign.com/blog/wp-content/uploads/2010/08/hd_php_form.zip"><img class="alignleft size-full wp-image-572" title="Download Source Files" src="http://www.hesslerdesign.com/blog/wp-content/uploads/2010/08/btn_downloadSourceFiles.png" alt="" width="176" height="29" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bulletproof Your Online Forms for Mobile Devices with PHP &#8211; Part 1</title>
		<link>http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-part-1/</link>
		<comments>http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-part-1/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 16:09:28 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=541</guid>
		<description><![CDATA[The more popular mobile devices get, the more reason there is to be cautious and deliberate when creating your website. While there are a bevy of issues in dealing with creating mobile-friendly sites, the one I’d like to focus on here is building out an HTML form. More specifically, since some mobile devices don’t have [...]]]></description>
			<content:encoded><![CDATA[<p>The more popular mobile devices get, the more reason there is to be cautious and deliberate when creating your website. While there are a bevy of issues in dealing with creating mobile-friendly sites, the one I’d like to focus on here is building out an HTML form. More specifically, since some mobile devices don’t have JavaScript enabled (either by default or by choosing, either way done to increase speed on your device), it’s not necessarily good to rely on JavaScript validation for your forms. And, since most current mobile devices aren’t Flash-friendly either (thank you Steve Jobs), the best method in creating a form is using HTML, styled with CSS, and using PHP for validation and processing.</p>
<p>With that said, here’s part 1 of how to build a bulletproof form using only HTML, PHP and CSS.</p>
<h4>Step 1: Plan Your Form</h4>
<p>This first step is important when building out a form.  Rather than just jumping in and starting to throw together a form, it&#8217;s helpful (and a big time-saver) to plan out what fields your form will have, and what types of fields they will be.  I find it helpful to either jot this info down on a piece of paper, or write it in pseudo-code inside of a comment block in my working file.  Either way, plan your form fields first.  It will make life much easier as you build out the form, and eventually its validation and processing.</p>
<p>For this tutorial, we&#8217;ll build out a form with three fields: Name, Email, and Message.  The form will also have a Submit and Reset button for form processing and resetting.</p>
<h4>Step 2: Create PHP Variables for Each Form Field Value</h4>
<p>Now that we have the form architecture figured out, we need to assign a PHP variable to each form field.  In our example, this means we’ll need 3 variables.  So at the very top of our file, inside of the PHP wrapper tags (<strong><span style="color: #ff0000;"><code>&lt;?php ?&gt;</code></span></strong>), create a variable for each.  In our example, it will look like this:</p>
<p><code><strong><span style="color: #ff0000;">&lt;?php</span></strong><br />
$user_name <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
$user_email <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
$user_message <span style="color: #0000ff;">=</span> <span style="color: #cc0000;">""</span>;<br />
<strong><span style="color: #ff0000;">?&gt;</span></strong></code></p>
<p><em>Note: This step could be swapped with step #3 below, but for the sake of  brevity in this tutorial, I&#8217;m putting it here so we can plug these  variable values directly in the form fields when we build out the form  in step #3.</em></p>
<p><span id="more-541"></span></p>
<h4>Step 3: Build Out the Form</h4>
<p>This step is simple, as we just need to put together the pure HTML code for our form.  Our form will have two <code>input</code> fields and one <code>textarea</code> (for the message).  While assembling the code, I&#8217;m going to insert some extra <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code> tags that are inserted to break up the form into containers in the absence of CSS.  This is done as a precaution for mobile devices that are not set up to enable CSS.  Many times the default is okay, but I&#8217;ve noticed that here and there, you need to hammer it down a little bit.</p>
<p>Another important thing that we&#8217;ll do here is to set the value of each form field to its accompanying PHP variable.  This is a setup step that will ensure that our form will &#8220;remember&#8221; its values, should any of the form fields fail in the validation process (still to come).  You know what I mean here – we’ve all been there – you fill out a long form, submit, and find out that the form is somehow invalid, and all of the form fields are blank again, forcing you to refill the entire thing all over again.  Frustrating, isn’t it?</p>
<p>This is actually much easier than you might think using PHP.  For the <code>input</code> fields, it’s a simple matter of echoing out the PHP variable inside of the ‘value’ attribute of the tag.  For the <code>textarea</code>, you’ll need to echo out the PHP variable between the opening and closing tags.  And don’t worry – since our PHP variables are set as empty strings by default, the fields will also be empty when the form initially loads.  But as the form and validation logic get built out, our PHP variables are set to match the form fields, and thus the form fields will be populated with the &#8220;remembered&#8221; value of the field (stored in the variables) rather than being blank.</p>
<p>In our example, our form looks a little something like this:</p>
<p><code><span style="color: #ff9900;">&lt;form action=</span><span style="color: #0000ff;">""</span> <span style="color: #ff9900;">method=</span><span style="color: #0000ff;">"post"</span> <span style="color: #ff9900;">name=</span><span style="color: #0000ff;">"contact_form"</span> <span style="color: #ff9900;">id=</span><span style="color: #0000ff;">"contact_form"</span><span style="color: #ff9900;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;div&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;label for=</span><span style="color: #0000ff;">"user_name"</span><span style="color: #ff9900;">&gt;</span>Your Name:<span style="color: #ff9900;">&lt;/label&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000099;">&lt;span class=</span><span style="color: #0000ff;">"hidden"</span><span style="color: #000099;">&gt;&lt;br /&gt;&lt;/span&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;input type=</span><span style="color: #0000ff;">"text"</span> <span style="color: #ff9900;">name=</span><span style="color: #0000ff;">"user_name"</span> <span style="color: #ff9900;">value=</span><span style="color: #0000ff;">"</span><span style="color: #ff0000;">&lt;?php</span> <span style="color: #0000ff;">echo</span> $user_name; <span style="color: #ff0000;">?&gt;</span><span style="color: #0000ff;">"</span> <span style="color: #ff9900;">autocomplete=</span><span style="color: #0000ff;">"off"</span> <span style="color: #ff9900;">tabindex=</span><span style="color: #0000ff;">"1"</span> <span style="color: #ff9900;">/&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;/div&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;div&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;label for=</span><span style="color: #0000ff;">"user_email"</span><span style="color: #ff9900;">&gt;</span>Your Email:<span style="color: #ff9900;">&lt;/label&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000099;">&lt;span class=</span><span style="color: #0000ff;">"hidden"</span><span style="color: #000099;">&gt;&lt;br /&gt;&lt;/span&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;input type=</span><span style="color: #0000ff;">"text"</span> <span style="color: #ff9900;">name=</span><span style="color: #0000ff;">"user_email"</span> <span style="color: #ff9900;">value=</span><span style="color: #0000ff;">"</span><span style="color: #ff0000;">&lt;?php</span> <span style="color: #0000ff;">echo</span> $user_email; <span style="color: #ff0000;">?&gt;</span><span style="color: #0000ff;">"</span> <span style="color: #ff9900;">autocomplete=</span><span style="color: #0000ff;">"off"</span> <span style="color: #ff9900;">tabindex=</span><span style="color: #0000ff;">"2"</span> <span style="color: #ff9900;">/&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;/div&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;div&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;label for=</span><span style="color: #0000ff;">"user_message"</span><span style="color: #ff9900;">&gt;</span>Message:<span style="color: #ff9900;">&lt;/label&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000099;">&lt;span class=</span><span style="color: #0000ff;">"hidden"</span><span style="color: #000099;">&gt;&lt;br /&gt;&lt;/span&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;textarea name=</span><span style="color: #0000ff;">"user_message"</span> <span style="color: #ff9900;">autocomplete=</span><span style="color: #0000ff;">"off"</span> <span style="color: #ff9900;">wrap=</span><span style="color: #0000ff;">"physical"</span> <span style="color: #ff9900;">tabindex=</span><span style="color: #0000ff;">"3"</span><span style="color: #ff9900;">&gt;</span><span style="color: #ff0000;">&lt;?php</span> <span style="color: #0000ff;">echo</span> $user_message; <span style="color: #ff0000;">?&gt;</span><span style="color: #ff9900;">&lt;/textarea&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;/div&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;div class=</span><span style="color: #0000ff;">"centered"</span><span style="color: #000099;">&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;input type=</span><span style="color: #0000ff;">"submit"</span> <span style="color: #ff9900;">name=</span><span style="color: #0000ff;">"submit"</span> <span style="color: #ff9900;">value=</span><span style="color: #0000ff;">"Submit &amp;raquo;"</span> <span style="color: #ff9900;">/&gt;</span><br />
&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #ff9900;">&lt;input type=</span><span style="color: #0000ff;">"submit"</span> <span style="color: #ff9900;">name=</span><span style="color: #0000ff;">"reset"</span> <span style="color: #ff9900;">value=</span><span style="color: #0000ff;">"Reset Form"</span> <span style="color: #ff9900;">/&gt;</span><br />
&nbsp; &nbsp;<span style="color: #000099;">&lt;/div&gt;</span><br />
<span style="color: #ff9900;">&lt;/form&gt;</span></code></p>
<p>A few important notes about the form setup:</p>
<ul>
<li>We didn&#8217;t include any value in the action attribute for the form tag.  This is because we&#8217;re going to house all of the form logic within the same file to reduce page-to-page navigation, and the amount of external files we need to concern ourselves with.  There are different schools of thought about this, but this is the method we&#8217;ll use for this tutorial.</li>
<li>As discussed above, PHP markup has been inserted into the form fields as their values.</li>
<li>Each form field tag has a unique name.  This will be necessary when we start to set/reset variables and validate the form later on down the road.</li>
<li>Each form field is set up here with the autocomplete attribute set to &#8220;off&#8221;. This is just more of a security precaution that I like on contact forms, that makes it so the browser doesn&#8217;t remember previous values you&#8217;ve typed in other forms, in the case that you&#8217;re using a public computer that doesn&#8217;t delete private browsing history.  <em>(Note: This doesn&#8217;t have anything to do with the method we&#8217;re using to echo out our PHP variables into the form, as our PHP variable method will simply keep our values in the form upon unsuccessful form submission, whereas the autocomplete attribute would have a dropdown of &#8220;remembered&#8221; values of past forms when the user starts typing.)</em></li>
<li>Overall, I&#8217;ve included a number of ids and classes in the form that will be later used to style it with CSS for browsers and mobile devices that have CSS enabled.</li>
</ul>
<h4>What&#8217;s Next</h4>
<p>We now have the framework for our form, and have set up some of the initial PHP logic to help us populate and store form values.  In the next segment, we&#8217;ll work on adding in the variable setting/resetting functionality, as well as the validation functions.  Also, and most importantly, we&#8217;ll tie in the Submit and Reset buttons with the correct functionality to make the form do what it&#8217;s supposed to do.</p>
<p>Until the next part of this tutorial, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/tutorials/bulletproof-your-online-forms-for-mobile-devices-with-php-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look Mom, No Flash!</title>
		<link>http://www.hesslerdesign.com/blog/web-design/look-mom-no-flash/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/look-mom-no-flash/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 18:27:02 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=500</guid>
		<description><![CDATA[Whew!  It&#8217;s been far too long since my last ramblings on the blog here.  And c&#8217;mon&#8230;what&#8217;s up with that title?  No Flash?  Don&#8217;t worry, I&#8217;m not turning anti-Flash like Steve Jobs or anything.  Heck, I continue to do a ton of Flash development work, and seriously enjoy doing it.  No, it&#8217;s nothing like that.  I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Whew!  It&#8217;s been far too long since my last ramblings on the blog here.  And c&#8217;mon&#8230;what&#8217;s up with that title?  No Flash?  Don&#8217;t worry, I&#8217;m not turning anti-Flash like Steve Jobs or anything.  Heck, I continue to do a ton of Flash development work, and seriously enjoy doing it.  No, it&#8217;s nothing like that.  I&#8217;ll just that I&#8217;ve just launched an updated version of <a title="Hessler Design - Home" href="http://www.hesslerdesign.com/" target="_self">HesslerDesign.com</a> that includes absolutely no Flash elements whatsoever (minus the blog section, because I write about Flash quite a bit as you can probably tell).</p>
<p>Why, you ask?</p>
<p>As time goes on, I&#8217;m finding myself drawing closer and closer to sticking close to pure HTML/CSS code, with other standards-compliant languages like PHP/MySQL and JavaScript.  Not to say Flash and it&#8217;s programming language (ActionScript) isn&#8217;t compliant with anything.  I had simply found myself doing things in Flash by default because it&#8217;s what I was most comfortable with, and could do with the least amount of technical issues.</p>
<p>But, now that I&#8217;ve been exploring more uses for JavaScript in place of what would normally be Flash code, it&#8217;s easier and easier to pull myself away from Flash.  Plus, as I&#8217;ve been doing more and more dynamic code content with PHP, I&#8217;m finding myself a lot more excited about using PHP than I am about using Flash.  I still enjoy Flash, and don&#8217;t get me wrong &#8212; there are definitely times and places for Flash.  But for where I&#8217;m at now, I am finding that my own site doesn&#8217;t currently need to rely on Flash so much.</p>
<p>Outside of the programming techniques used for the most recent release of the site, I felt like it was definitely the time for a change regarding the design of the site.  The new design has a much more sophisticated simplicity and clean look than the old version. It&#8217;s focus is more on the projects and artwork, as they take a very prominent position on the <a title="Hessler Design - Work" href="http://www.hesslerdesign.com/" target="_self">Work</a> page with only the project details to accompany them.  No fluff content just to fill in space and give users something else to read.  Only the necessities.</p>
<p>With that all said, I hope you enjoy the newest iteration of HesslerDesign.com.  If you haven&#8217;t already, check out the <a title="Hessler Design - Work" href="http://www.hesslerdesign.com/" target="_self">Work</a> page, which has a few new projects listed that I&#8217;ve completed recently.  I hope you like what you see.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/look-mom-no-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designers Unite with Help from the Design Police!</title>
		<link>http://www.hesslerdesign.com/blog/design/designers-unite-with-help-from-the-design-police/</link>
		<comments>http://www.hesslerdesign.com/blog/design/designers-unite-with-help-from-the-design-police/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 18:29:18 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=494</guid>
		<description><![CDATA[For all you designers out there, you&#8217;ve inevitably had numerous encounters with colleagues and/or clients who had more than their two cents worth on a given design project. You&#8217;ve no doubt had to carefully and diplomatically state your case, and why certain design decisions are better than others, and why there is a need to [...]]]></description>
			<content:encoded><![CDATA[<p>For all you designers out there, you&#8217;ve inevitably had numerous encounters with colleagues and/or clients who had more than their two cents worth on a given design project. You&#8217;ve no doubt had to carefully and diplomatically state your case, and why certain design decisions are better than others, and why there is a need to trust a design professional, rather than&#8230;well&#8230;Microsoft Word or PowerPoint.</p>
<p>If you&#8217;ve had your fill of being overly nice trying to convey your ideas, I am happy to announce that there is now a service out there that is here to help: <strong>Design Police</strong> (<a title="Design Police" href="http://www.design-police.org/" target="_blank">http://www.design-police.org/</a>). I stumbled across this site site after seeing it featured in a blog post on <a title="Smashing Magazine" href="http://www.smashingmagazine.com/" target="_blank">Smashing Magazine</a> and knew that it is a keeper, and one that I had to share with readers.</p>
<p>The mission of <strong><a title="Design Police" href="http://www.design-police.org/" target="_blank">Design Police</a></strong> is simple: <strong>Bring bad design to justice</strong>. Through their innovative kit that is available for download, you can use their material when editing and marking up designs. Trust me &#8212; it&#8217;s well worth it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/design/designers-unite-with-help-from-the-design-police/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Life on the Edge: Making Your Website Span to the Edge of the Browser Window</title>
		<link>http://www.hesslerdesign.com/blog/web-design/life-on-the-edge-making-your-website-span-to-the-edge-of-the-browser-window/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/life-on-the-edge-making-your-website-span-to-the-edge-of-the-browser-window/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 15:15:14 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=490</guid>
		<description><![CDATA[Here&#8217;s an oldie, but a goodie.  One of the questions I get a lot is, &#8220;Why isn&#8217;t my website reaching all the way to the edge of the browser window, and how do I get it to do that?&#8221;  Well, the answer is very simple, and it&#8217;s easily taken care of with one line of [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an oldie, but a goodie.  One of the questions I get a lot is, &#8220;Why isn&#8217;t my website reaching all the way to the edge of the browser window, and how do I get it to do that?&#8221;  Well, the answer is very simple, and it&#8217;s easily taken care of with one line of CSS code.</p>
<p>In your CSS code, simply assign the following:</p>
<p><span style="margin-left: 24px; margin-right: 24px;"><code>html body {margin:0px; padding:0px}</code></span></p>
<p>That&#8217;s it. Seriously. By default, most (I hesitate to say all) browsers have a built in 10px or so padding around the edge of the window. By setting your html and body to have no margin or padding, it effectively overwrites the browser default values and uses yours.</p>
<p>While you&#8217;re at it, you might also be wondering how you can center your main container in the browser window, instead of having it left-justified.  This too is easy to implement with one snippet of CSS.  Let&#8217;s go ahead and assume that your main div container has the ID &#8220;container&#8221;. Your CSS code to center the div &#8220;container&#8221; will be:</p>
<p><span style="margin-left: 24px; margin-right: 24px;"><code>#container {margin: 0 auto; width:960px;}</code></span></p>
<p>Notice that in this example, you need to fix your width to a certain value so the container knows not to take up 100%. The margin setting &#8220;0 auto&#8221; tells the container to have a margin of 0 (zero) pixels on top and bottom, with auto margins on the left and  right.</p>
<p>So there you have it. Two basic CSS rules to make your page go all the way up to the edge of the browser window, and to center your main container in the window.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/life-on-the-edge-making-your-website-span-to-the-edge-of-the-browser-window/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimize Your Website&#8217;s SEO with the Help of SEOmoz</title>
		<link>http://www.hesslerdesign.com/blog/web-design/optimize-your-websites-seo-with-the-help-of-seomoz/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/optimize-your-websites-seo-with-the-help-of-seomoz/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 17:50:05 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=486</guid>
		<description><![CDATA[One question I get repeatedly is, &#8220;How can I improve my search rankings?&#8221;  While there&#8217;s a vast array of variables that go into search rankings, most of which are beyond the comprehension of non-Google developers, there is a site that is devoted to providing information on Search Engine Optimization (SEO).  That site is: seomoz.org. SEOmoz [...]]]></description>
			<content:encoded><![CDATA[<p>One question I get repeatedly is, &#8220;How can I improve my search rankings?&#8221;  While there&#8217;s a vast array of variables that go into search rankings, most of which are beyond the comprehension of non-Google developers, there is a site that is devoted to providing information on Search Engine Optimization (SEO).  That site is: <a title="SEOmoz" href="http://www.seomoz.org" target="_blank">seomoz.org</a>.</p>
<p>SEOmoz is a popular provider of SEO software.  It&#8217;s website is dedicated to all things SEO, including a blog, helpful articles and user guides, and best of all, a set of tools that webmasters can use to help their site&#8217;s SEO.  Some of the tools are only available to &#8220;Pro&#8221; members, which costs money.  But a little over half of them (at the writing of this entry) are completely free to use (some with daily restrictions on use).</p>
<p>One of the coolest free tools available to anyone is the <a title="SEO Toolbar for Firefox" href="http://www.seomoz.org/seo-toolbar" target="_blank">SEO Toolbar for Firefox</a>.  With the toolbar, you can access any of the SEOmoz tools right from the toolbar, without having to go to the actual site first.  It&#8217;s incredibly handy, and also includes stats like Page Authority and Domain Authority, which give real-time stats on the site you&#8217;re currently on.</p>
<p>So next time you get the question, &#8220;How can I improve my search rankings?&#8221;, look to <a title="SEOmoz" href="http://www.seomoz.org" target="_blank">SEOmoz.org</a> as your first (and likely, only) stop for resources and tools to help guide you on your road to SEO success.</p>
<p>Until next time, happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/optimize-your-websites-seo-with-the-help-of-seomoz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find My Fold &#8211; A Modern Definition of the Web&#8217;s &#8216;Fold&#8217;</title>
		<link>http://www.hesslerdesign.com/blog/web-design/find-my-fold-a-modern-definition-of-the-webs-fold/</link>
		<comments>http://www.hesslerdesign.com/blog/web-design/find-my-fold-a-modern-definition-of-the-webs-fold/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 20:17:56 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[fold]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=480</guid>
		<description><![CDATA[Time and time again, I get the request nearly every designer hates hearing: &#8220;Will this be above the fold?&#8221; Innocent enough question, but honestly, anyone who asks this is still living in the 20th Century.  The reasons are numerous for why &#8220;the fold&#8221; is obsolete for websites. Instead of explaning them here, I&#8217;ll point you [...]]]></description>
			<content:encoded><![CDATA[<p>Time and time again, I get the request nearly every designer hates hearing: &#8220;Will this be above the fold?&#8221; Innocent enough question, but honestly, anyone who asks this is still living in the 20th Century.  The reasons are numerous for why &#8220;the fold&#8221; is obsolete for websites. Instead of explaning them here, I&#8217;ll point you to a great site that&#8217;ll do the job for me: <a title="Find My Fold" href="http://www.findmyfold.com" target="_blank">FindMyFold.com</a>.</p>
<p>Okay, truthfully the shameless plug of <a title="Find My Fold" href="http://www.findmyfold.com" target="_blank">FindMyFold.com</a> is quite self-serving. Between me, you, Google, the Internet, and Al Gore, I sort of created the site. I thought it high time to do my duty as a designer and developer, and offer the site as a public service to the world.</p>
<p>So the next time someone asks you, &#8220;Is this going to be above the &#8216;fold&#8217;?&#8221;, point them to <a title="Find My Fold" href="http://www.findmyfold.com" target="_blank">FindMyFold.com</a>. At the site, you see what <em><strong>your</strong></em> fold is in <em><strong>your</strong></em> own browser.  Plus, there&#8217;s a handy-dandy &#8220;<em>Test Your Site&#8217;s Fold</em>&#8221; feature that you can use to test <em><strong>any site</strong></em> to see where your fold lands on that particular page.</p>
<p>Oh yeah, and while you&#8217;re there, make sure to share the news with your friends, with the built-in social links.  Let&#8217;s spread the news and get everyone up to speed!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/web-design/find-my-fold-a-modern-definition-of-the-webs-fold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VideoMax Custom Flash Video Player Class Now Available!</title>
		<link>http://www.hesslerdesign.com/blog/flash/mediaplayer-custom-flash-video-player-class-now-available/</link>
		<comments>http://www.hesslerdesign.com/blog/flash/mediaplayer-custom-flash-video-player-class-now-available/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 01:00:27 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.hesslerdesign.com/blog/?p=336</guid>
		<description><![CDATA[What is VideoMax? VideoMax is a very lightweight, fast, flexible, and easy-to-implement custom Flash video player class that can be used in any ActionScript 3.0 file. Some of the key highlights of the VideoMax class are: Lightweight: Importing the VideoMax class and creating an instance adds only 12kb to overall file weight. Compare that to [...]]]></description>
			<content:encoded><![CDATA[<h4>What is VideoMax?</h4>
<p>VideoMax is a very lightweight, fast, flexible, and easy-to-implement custom Flash video player class that can be used in any ActionScript 3.0 file. Some of the key highlights of the VideoMax class are:</p>
<ul>
<li><strong>Lightweight:</strong> Importing the VideoMax class and creating an instance adds only 12kb to overall file weight. Compare that to the built-in Adobe &#8216;flvPlayback&#8217; component, which adds 58kb to the overall file weight. Do the math. That&#8217;s nearly 500% heavier than this VideoMax class.</li>
<li><strong>Easy to Use:</strong> With just 3 lines of code, you can import the VideoMax class, create an instance of the player, and add it to your Flash file. And because of its dynamically-built nature, there are NO Library components needed. That&#8217;s right, NONE. All of the assets included in the VideoMax class are 100% built from scratch with nothing but ActionScript 3.0 code.</li>
<li><strong>Customizable:</strong> You can change a number of attributes to your VideoMax instances, so you can have a video player that is as unique as the video it plays. The customizable attributes include Width, Height, Auto Play, Auto Rewind, Auto Size, Buffer, Looping, Control Bar visibility, Tint, Play Button overlay, End Frame visibility, and onStart/onComplete listeners.</li>
<li><strong>Communicative:</strong> By using the onStart and onComplete listener attributes (and accompanying parameter attributes), you can have VideoMax dispatch events that call functions back in the parent file when the video starts and/or ends.</li>
<li><strong>Self-Sufficient:</strong> With its robust set of default attributes, VideoMax takes care of wrapping up all of the loose ends. Once you create your VideoMax instance, you can sit back and relax, knowing that everything is taken care of, including control bar resizing and positioning, buffering, automatic video resizing within the player, and more. Just import the class, create the instance, assign it attributes, and add it to your file. VideoMax will take care of the rest for you.</li>
</ul>
<h4>Where Can I Get VideoMax?</h4>
<p>VideoMax is available for download at the <a href="http://www.hesslerdesign.com/videomax">Official VideoMax Page</a> on HesslerDesign.com. There, you will find a free download of VideoMax, as well as examples and documentation on implementing VideoMax in your own Flash projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hesslerdesign.com/blog/flash/mediaplayer-custom-flash-video-player-class-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
