<?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/"
	>

<channel>
	<title></title>
	<atom:link href="http://www.e3webdesigns.com/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.e3webdesigns.com/wordpress</link>
	<description></description>
	<pubDate>Sun, 27 Sep 2009 01:12:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Coldfusion temperature conversion web service</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=234</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=234#comments</comments>
		<pubDate>Sat, 26 Sep 2009 16:38:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Coldfusion]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=234</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/09/temp.jpg" alt="temp" title="temp" width="190" height="151" class="alignleft size-full wp-image-238" />Time for a little example of Coldfusion web services!  You heard me right, we are going to delve into a short and sweet example of how to create, and invoke a web service using Coldfusion!
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/09/temp.jpg" alt="temp" title="temp" width="190" height="151" class="alignleft size-full wp-image-238" />Time for a little example of Coldfusion web services!  You heard me right, we are going to delve into a short and sweet example of how to create, and invoke a web service using Coldfusion!</p>
<p>It&#8217;s a very simple example of converting a temperature value from Farenheit to Celsius or vice versa.  This will all be done by creating a form to accept user input, and a web service containing the logic to perform the conversion operations.  Let&#8217;s hit it!</p>
<p>Our example will consist of three files.  convTempForm which is the web form to accept user input, convTemp to process the input, call the web service, and display the results, and finally the web service Coldfusion component itself.  Easy cheesy!</p>
<p>First let&#8217;s take a look at our user form:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Temperature Conversion Web Service&lt;/title&gt;
&lt;style&gt;
form{background-color:#99CC66; padding:10px;}
input, select{display:block;margin-bottom:5px;}
&lt;/style&gt;
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&lt;form action=&quot;convTempForm.cfm&quot; method=&quot;post&quot;&gt;
    Provide a temperature:
    	&lt;input name=&quot;temperature&quot; type=&quot;text&quot;/&gt;
    Choose a Conversion:
        &lt;select name=&quot;conversionType&quot;&gt;
            &lt;option value=&quot;CtoF&quot;&gt;Celsius to Farenheit&lt;/option&gt;
            &lt;option value=&quot;FtoC&quot;&gt;Farenheit to Celsius&lt;/option&gt;
        &lt;/select&gt;
    &lt;input name=&quot;submitform&quot; type=&quot;submit&quot; value=&quot;Submit&quot;/&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Nothing out of the ordinary here.  We have a basic form that accepts a text value named temperature, and a conversion selection of either F to C, or C to F.  Then a submit button posts the input to the action page.</p>
<p>Here is our action page:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> #form.conversionType# <span style="color: #0000FF;">is</span> <span style="color: #009900;">&quot;CtoF&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
		convertTemp = CreateObject(&quot;webservice&quot;, &quot;http://localhost:8500/tempConversion/convComponent.cfc?wsdl&quot;);
		newTemp = convertTemp.ctof(&quot;<span style="color: #0000FF;">#form.temperature#</span>&quot;);
		inxml = getSOAPRequest(convertTemp);
		outxml = getSOAPResponse(convertTemp);
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
    	<span style="color: #0000FF;">#form.temperature#</span> &amp;deg;C is <span style="color: #0000FF;">#Round<span style="color: #0000FF;">&#40;</span>newTemp<span style="color: #0000FF;">&#41;</span>#</span> &amp;deg;F.
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfelseif</span> #form.conversionType# <span style="color: #0000FF;">is</span> <span style="color: #009900;">&quot;FtoC&quot;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
		convertTemp = CreateObject(&quot;webservice&quot;, &quot;http://localhost:8500/tempConversion/convComponent.cfc?wsdl&quot;);
		newTemp = convertTemp.ftoc(&quot;<span style="color: #0000FF;">#form.temperature#</span>&quot;);
		inxml = getSOAPRequest(convertTemp);
		outxml = getSOAPResponse(convertTemp);
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
        <span style="color: #0000FF;">#form.temperature#</span> &amp;deg;F is <span style="color: #0000FF;">#Round<span style="color: #0000FF;">&#40;</span>newTemp<span style="color: #0000FF;">&#41;</span>#</span> &amp;deg;C.
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>This is our coldfusion form processing page that receives the posted data, and calls the web service component to perform the calculations.  The way it gathers the data from the form is by using the variable scope &#8216;form&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #0000FF;">#form.conversionType#</span></pre></div></div>

<p>There are two scenarios presented here.  One is if the user chose CtoF from the select form element, and another if the user chose FtoC.  Both scenarios call the same web service component, but separate methods.  We use a coldfusion if/else statement to determine which method to target.</p>
<p>If the user wants to convert from Celsius to Farenheit, the if part of our if/else statement will trigger, and we create a web service object and target the &#8216;ctof&#8217; method.  If the user wants to convert from Farenheit to Celsius then the else part of our if/else statement is triggered and we create a web service object and target the &#8216;ftoc&#8217; method.</p>
<p>Let&#8217;s get granular on this puppy.  If our user provides a temperature of 45 degrees, and chooses to convert it from celsius to farhenheit, that data is posted to the action page of our form and is used to determine the if/else statement.  In this case the if statement is triggered because the #form.conversionType# is &#8216;CtoF&#8217;.  So our the first part of our if statement is true</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> #form.conversionType# <span style="color: #0000FF;">is</span> <span style="color: #009900;">&quot;CtoF&quot;</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Because it is true the logic included in the if statement will no run</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
		convertTemp = CreateObject(&quot;webservice&quot;, &quot;http://localhost:8500/tempConversion/convComponent.cfc?wsdl&quot;);
		newTemp = convertTemp.ctof(&quot;<span style="color: #0000FF;">#form.temperature#</span>&quot;);
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>What we have here is a cfscript tag with several variable declarations.  First we create an instance of our web service&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">convertTemp = CreateObject(&quot;webservice&quot;, &quot;http://localhost:8500/tempConversion/convComponent.cfc?wsdl&quot;);</pre></div></div>

<p>This instance of the web service is stored in the variable convertTemp.  The CreateObject function is one that creates an object of the assigned type (in this case &#8216;web service&#8217;), and the absolute URL to the WSDL that describes the web service.</p>
<p>Next we assign a variable to hold the result of the targeted web service function&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">newTemp = convertTemp.ctof(&quot;<span style="color: #0000FF;">#form.temperature#</span>&quot;);</pre></div></div>

<p>Using dot syntax we scope the method that exists within the instance of the web service object, and we pass to it the value that our user supplied in the form.  Before we look at the result of the method logic, let&#8217;s look at the actual web service component that will perform the logic.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span>    
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;ctof&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;remote&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;numeric&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;no&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #808080; font-style: italic;">&lt;!--- Celsius to Fahrenheit conversion method. ---&gt;</span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;temp&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;yes&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;numeric&quot;</span><span style="color: #0000FF;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> <span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#40;</span>temp*<span style="color: #FF0000;">9</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">/</span><span style="color: #FF0000;">5</span><span style="color: #0000FF;">&#41;</span>+<span style="color: #FF0000;">32</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;ftoc&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;remote&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;numeric&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;no&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #808080; font-style: italic;">&lt;!--- Fahrenheit to Celsius conversion method. ---&gt;</span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;temp&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;yes&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;numeric&quot;</span><span style="color: #0000FF;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> <span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#40;</span>temp-<span style="color: #FF0000;">32</span><span style="color: #0000FF;">&#41;</span>*<span style="color: #FF0000;">5</span><span style="color: #0000FF;">/</span><span style="color: #FF0000;">9</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>
Here we see the coldfusion component that performs the logical operations on our users input.  Depending on their choice (&#8217;CtoF&#8217; or &#8216;FtoC&#8217; ) the associated method with the same name will run.  The arguments you see in the component are required for the method to run, and the name of the argument, &#8216;temp&#8217; is a variable that is passed the value provided by the user in the form ( #form.temperature# ).  The type of data the argument will accept is set to numeric, so it must be a number.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;temp&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;yes&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;numeric&quot;</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Once the argument is passed the value, it can now be used in the calculation to be returned to the user.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> <span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#40;</span>temp*<span style="color: #FF0000;">9</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">/</span><span style="color: #FF0000;">5</span><span style="color: #0000FF;">&#41;</span>+<span style="color: #FF0000;">32</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>The cfreturn tag will perform the calculation ( passed value multiplied by 9, then divided by 5, then summed with 32 ), and then return the result to the logic that created and called the web service.</p>
<p>Remember this line from our action page?</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">newTemp = convertTemp.ctof(&quot;<span style="color: #0000FF;">#form.temperature#</span>&quot;);</pre></div></div>

<p>The variable &#8216;newTemp&#8217; holds the result of the web service operation, and can now be displayed on our page.</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #0000FF;">#form.temperature#</span> &amp;deg;C is <span style="color: #0000FF;">#Round<span style="color: #0000FF;">&#40;</span>newTemp<span style="color: #0000FF;">&#41;</span>#</span> &amp;deg;F.
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>The original form scoped temperature provided by our user is included in a string that includes the rounded return value of the function</p>
<p>Some key points:</p>
<p>ColdFusion scripting</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>allows you to write portions of your templates with script-based syntax, which is often more concise and straightforward than ColdFusion’s traditional tag-based syntax.</p>
<p>The Round() function rounds a number to the closest integer that is larger than the input parameter, and returns an integer.</p>
<p>Happy scripting!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=234</wfw:commentRss>
		</item>
		<item>
		<title>The Mack Daddy of Contact Forms!</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=198</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=198#comments</comments>
		<pubDate>Sun, 20 Sep 2009 18:45:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=198</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/09/contact.jpg" alt="contact" title="contact" width="190" height="151" class="alignleft size-full wp-image-229" />This is it folks; the beast!  This is the contact form to rule them all!

What we have here is a contact form structured with a nice marriage of XHTML and CSS, validated via jQuery, a dynamically generated captcha image for security, and PHP logic to handle the transfer of data.  Not enough for you?  Too bad.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/09/contact.jpg" alt="contact" title="contact" width="190" height="151" class="alignleft size-full wp-image-229" />This is it folks; the beast!  This is the contact form to rule them all!</p>
<p>What we have here is a contact form structured with a nice marriage of XHTML and CSS, validated via jQuery, a dynamically generated captcha image for security, and PHP logic to handle the transfer of data.  Not enough for you?  Too bad.</p>
<p>Let&#8217;s do this&#8230;</p>
<p>We start out with a basic XHTML form structured with your run of the mill form elements:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;style&quot;&gt;
&lt;form id=&quot;myform&quot; name=&quot;myform&quot; method=&quot;post&quot; action=&quot;&quot; onsubmit=&quot;return checkform()&quot;&gt;
&lt;div id=&quot;group1&quot;&gt;
&lt;label&gt;Name
&lt;span class=&quot;small&quot;&gt;Please tell us your name&lt;/span&gt;&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; onkeydown=&quot;inputCounter(this.form.name,this.form.remName,30);&quot; onkeyup=&quot;textCounter(this.form.name,this.form.remName,30);&quot; class=&quot;text-input&quot;/&gt;
&lt;label class=&quot;error&quot; for=&quot;name&quot; id=&quot;name_error&quot;&gt;You must provide your name!&lt;/label&gt;
&lt;label&gt;Email
&lt;span class=&quot;small&quot;&gt;Please provide your email&lt;/span&gt;&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; onkeydown=&quot;inputCounter(this.form.email,this.form.remEmail,30);&quot; onkeyup=&quot;textCounter(this.form.email,this.form.remEmail,30);&quot; class=&quot;text-input&quot;/&gt;
&lt;label class=&quot;error&quot; for=&quot;email&quot; id=&quot;email_error&quot;&gt;Please provide a valid email!&lt;/label&gt;
&lt;label&gt;Message
&lt;span class=&quot;small&quot;&gt;Please provide a detailed message&lt;/span&gt;&lt;/label&gt;
&lt;textarea name=&quot;message&quot; id=&quot;message&quot; cols=&quot;60&quot; rows=&quot;5&quot; onkeydown=&quot;textCounter(this.form.message,this.form.remLen,512);&quot; onkeyup=&quot;textCounter(this.form.message,this.form.remLen,512);&quot; class=&quot;text-input&quot;&gt;&lt;/textarea&gt;
&lt;label class=&quot;error&quot; for=&quot;message&quot; id=&quot;message_error&quot;&gt;What, no message?&lt;/label&gt;
&nbsp;
&lt;div id=&quot;captcha&quot;&gt;
&lt;p&gt;&lt;img src=&quot;/Scripts/captcha.php&quot; /&gt;&lt;/p&gt;
&lt;label&gt;Security Code
&lt;span class=&quot;small&quot;&gt;Enter code from image&lt;/span&gt;&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;code&quot; id=&quot;code&quot;  onkeydown=&quot;inputCounter(this.form.code,this.form.remName,5);&quot; onkeyup=&quot;textCounter(this.form.code,this.form.remName,5);&quot; class=&quot;text-input&quot;/&gt;
&lt;label class=&quot;error&quot; for=&quot;code&quot; id=&quot;code_error&quot;&gt;Please provide the code from the image!&lt;/label&gt;
&lt;label class=&quot;error&quot; for=&quot;code&quot; id=&quot;wrong_code&quot;&gt;Wrong Code! Please try again!&lt;/label&gt;
&nbsp;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&nbsp;
&lt;div class=&quot;buttons&quot;&gt;
&lt;button TYPE=reset NAME=&quot;resetButton&quot; VALUE=&quot;Reset&quot; class=&quot;button&quot;&gt;Clear&lt;/button&gt;
&lt;button TYPE=submit NAME=&quot;submitbutton&quot; VALUE=&quot;Submit&quot; class=&quot;button&quot;&gt;Submit&lt;/button&gt;
&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;/div&gt;</pre></div></div>

<p>The structure is styled via external CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#style</span> label<span style="color: #6666ff;">.error</span><span style="color: #00AA00;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Geneva<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FF0000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">15px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
label<span style="color: #cc00cc;">#name_error</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">/images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
label<span style="color: #cc00cc;">#email_error</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">/images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
label<span style="color: #cc00cc;">#message_error</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">/images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
label<span style="color: #cc00cc;">#code_error</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">/images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
label<span style="color: #cc00cc;">#wrong_code</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">/images/exclamation.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">scroll</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#response</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#response</span> p<span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0066CC</span><span style="color: #00AA00;">;</span>font-weight<span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #933;">6px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#response</span> p<span style="color: #6666ff;">.reply</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;"><span style="color: #cc66cc;">115</span>%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#checkmark</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>top<span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>left<span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#style</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#style</span> label<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#style</span> input<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#style</span> .button<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">80px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">31px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#style</span> .small<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>When the contact form loads in the browser we have several things that take place.  First and foremost we are using jQuery&#8217;s</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$(document).ready(function() { &quot;your magic here&quot; });</pre></div></div>

<p> to perform several DOM manipulations.  We use the aforementioned event to govern when the logic is performed, and in this case it all takes place when the DOM is finished loading, NOT the entire page;  JUST the DOM.</p>
<p>Basically this little chunk of jQuery makes sure that the logic waits only until the document structure is fully parsed before it performs its rich behaviors.  Traditionally one would use the old</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">window.onload = function(){ &quot;Your magic here&quot; };</pre></div></div>

<p> which executes the statements after the entire page has loaded in the browser, including all external resources such as images.  The jQuery method is simply faster.</p>
<p>We have an external validate.js javascript file that is linked to the page in the header.  Here is what takes place as soon as the DOM is fully parsed&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span> .<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#FFFFFF&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#bfddf7&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#FFFFFF&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#FFFFFF&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#bfddf7&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#FFFFFF&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#name&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">select</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>First jquery targets all elements with a class of &#8220;error&#8221; and hides them from the browser.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>These will pop up later only if the end user does not supply the necessary data.  Next all text-type form input elements are given a CSS style of a white background color.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#FFFFFF&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Jumping ahead the text area form element is also given a CSS style of a white background color.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#FFFFFF&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Finally the input form element with an id=&#8221;name&#8221; is selected, therefore gaining focus which triggers the input.text-input.focus function and gives it a new background color via CSS.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#name&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">select</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input.text-input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#bfddf7&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Sweet huh?  You will notice that there are two functions waiting to be triggered in the jQuery .ready function. .focus() and .blur().</p>
<p>Basically these two function are triggered everytime a form field gains focus or loses focus.  When a form field gains focus the .focus() function will trigger and change its background color from white to a nice blue.  When a form field loses focus the .blur() function triggers and changes its background color back to white.  Got it?  Good, moving on.</p>
<p>Once the form is loaded and everything is in place it&#8217;s time for the end user to start interacting with the form.  In the form you will notice the onsubmit attribute which targets a function called checkform, which exists in our external validate.js file.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> checkform<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.error'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#name&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;label#name_error&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#name&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
		<span style="color: #003366; font-weight: bold;">var</span> email <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#email&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>email <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;label#email_error&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#email&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
		<span style="color: #003366; font-weight: bold;">var</span> message <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea#message&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>message <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;label#message_error&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea#message&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
		<span style="color: #003366; font-weight: bold;">var</span> code <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#code&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>code <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;label#code_error&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#code&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
	checkcode<span style="color: #009900;">&#40;</span>code<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> textCounter<span style="color: #009900;">&#40;</span>limitField<span style="color: #339933;">,</span> limitCount<span style="color: #339933;">,</span> limitNum<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>limitField.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> limitNum<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		limitField.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> limitField.<span style="color: #660066;">value</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>limitNum<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		limitCount.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> limitNum <span style="color: #339933;">-</span> limitField.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> inputCounter<span style="color: #009900;">&#40;</span>limitField<span style="color: #339933;">,</span> limitCount<span style="color: #339933;">,</span> limitNum<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>limitField.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> limitNum<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		limitField.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> limitField.<span style="color: #660066;">value</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>limitNum<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		limitCount.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> limitNum <span style="color: #339933;">-</span> limitField.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So, once again any element with a class or &#8220;error&#8221; is hidden via jQuery.  Then we cascade down through a series of variable declarations and value validations.  We start with the name field by gathering the value that is provided by the end user.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#name&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then the logic uses that value to run an if statement, checking to see if there is anything there at all.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;label#name_error&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input#name&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>This little snippet performs a comparison (==) and checks if name is equal to null, or an empty string.  If it is, then obviously our end user has forgotten to provide this required data, and the label element with the id &#8220;name_error&#8221; is revealed using the .show function.  The name field is then given focus via the .focus function which helps to aid the end user.  return false stop execution of the script and keeps us on the same page.  If the value of name is not empty, then our end user has supplied some data, and the script continues on to the next bit of logic.</p>
<p>This exact bit of logic is repeated for the email, message, and security code form elements.</p>
<p>Jumping down a bit we see a bit of logic that serves to limit the characters in our input fields. This is to prevent malicious code from being injected into the system from all the bad apples out there.  I will not get into detail about this bit of logic.  Look for it in a separate post, because it is cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=198</wfw:commentRss>
		</item>
		<item>
		<title>IDs and Class Names</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=149</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=149#comments</comments>
		<pubDate>Mon, 16 Mar 2009 20:58:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cascading Style Sheets]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=149</guid>
		<description><![CDATA[An introduction to ID's and Classes; helping to make more detailed stylistic changes to your documents.]]></description>
			<content:encoded><![CDATA[<p>There are quite a few meaningful elements to hang your styles on in a typical (x)HTML document. Take a look at a few&#8230;</p>
<p>h1, h2, h3, etc.<br />
p, a, ol, li, ul<br />
td, tr, thead, tbody, tfoot<br />
blockquote, fieldset, legend</p>
<p>The list goes on and provides a very good foundation for applying your style rules. Sometimes though you just want a little more control over your pages. There are no dedicated elements to many of the areas of your documents that you would like to have control over. There is a way however to take existing elements and extend their meaning to your advantage by using css id&#8217;s and class names.</p>
<p>Think about the way you currently target an element. Let&#8217;s take a paragraph as an example. In a typical style rule that targets a paragraph you have your selector, attribute and value.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This will affect every p element that your style rule is connected to. This is not always desireable. If you only want to feature a single paragraph in red font, how can you do it without affecting them all? You can assign the paragraph an attribute value pair that sets it apart from the other p elements in your document. There are two ways to do this&#8230;</p>
<p>Class</p>
<p>You can assign desired elements a class which is typically used in situation where the affected elements share a common trait or similarity, like a date stamp or a heading style. If you have a number of elements on a page that you would like to feature with a unique style rule, assign them all to the same class and this one class in your style sheet will affect all of them as a group (or a class, like students in a classroom).</p>
<p>ID</p>
<p>Anything you assign an ID to must be unique. They are best at identifying a single unique element on a page, such as the navigation section, or a particular form element. You basically do not want anything other than this one element to receive the stylistic markup from the css, so it must be an id name that is used only once. Of course you could use the same id name on another element, but then they would share the style rule from the css, and now you have yourself a class. You&#8217;ll figure it out.</p>
<p>Let&#8217;s take a look at some examples&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ul id=&quot;navOne&quot;&gt;
&lt;li&gt;&lt;a class=&quot;anchors&quot; href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;anchors&quot; href=&quot;#&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;anchors&quot; href=&quot;#&quot;&gt;Profile&lt;/a&gt;&lt;/li&gt;
&lt;ul id=&quot;navTwo&quot;&gt;
&lt;li&gt;&lt;a class=&quot;anchors&quot; href=&quot;#&quot;&gt;Services&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;anchors&quot; href=&quot;#&quot;&gt;Location&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;anchors&quot; href=&quot;#&quot;&gt;Site Map&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#navOne</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">blue</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#navTwo</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">yellow</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.anchors</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>We have two lists, and each one has a unique ID assigned to it which makes it easy to style each of the lists different from the other. Each anchor within the li tags has a class of &#8220;anchors&#8221; which puts them all at the mercy of the exact same style rule as it is presented in the css.</p>
<p>In this way the designer has control over each of the two lists as a whole to set them apart, but each of the anchors will look the same to offer some sort of consistency.</p>
<p>In the css portion above you can see that ID&#8217;s are indicated by a hash mark(#) and the name of the id value from the html. Anchors are indicated by a period(.) and the name of the class value from the html.<br />
This is very subjective, and just for the purpose of presenting an example.</p>
<p>There are easier ways to target elements that will allow you to use less code and html markup. We will talk about that in another post. This is simply an intro to ID&#8217;s and classes.</p>
<p>Beat it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=149</wfw:commentRss>
		</item>
		<item>
		<title>CSS Selectors</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=97</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=97#comments</comments>
		<pubDate>Sun, 08 Mar 2009 23:47:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cascading Style Sheets]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=97</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/selectors.jpg" alt="selectors" title="selectors" width="190" height="151" class="alignleft size-full wp-image-259" />A little CSS target practice with selectors and elements.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/selectors.jpg" alt="selectors" title="selectors" width="190" height="151" class="alignleft size-full wp-image-259" />To successfully target a certain (x)HTML element it must first be well-formed. We use the selector portion of the css style rule to apply our styles to specific elements.</p>
<p>Common Selectors (element or simple selectors):</p>
<p>There are two common selectors called &#8216;type&#8217; and &#8216;descendant&#8217; selectors. Type selectors are used to target a specific type of element, hence the name. These elements can be paragraphs, anchors, headings, etc. You just specify the type of element you want to style. These are also called element selectors or simple selectors.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
a <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
h2 <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Descendant selectors target elements that reside inside another elements opening and closing tags. In the following example, all anchors inside the li (list) will be affected but no others; the a is a descendant of li.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li a <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>ID and Class:</p>
<p>You can be more specific in targeting elements by assigning them an ID or making them part of a class. In this way you can target only a certain group of elements (all sharing the same class) or a single element (with a unique ID). These selectors target the elements with the corresponding ID or class name only and leave all other elements alone.</p>
<p>You first assign the class or ID name within the target elements opening tag&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Introduction Text
&nbsp;
Mark Husband-Wood</pre></div></div>

<p>Then use the class and ID values to target them for styling&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#intro</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.author</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Universal selector:</p>
<p>This puppy is basically a wildcard, and it works by matching all available elements in the entire document. This will style every targeted element on the page, and it is denoted by an asterisk. The following css rule will set the margins and padding to 0 on every element. This is a powerful selector, so be careful!</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=97</wfw:commentRss>
		</item>
		<item>
		<title>Hyperlinks with icons via CSS</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=90</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=90#comments</comments>
		<pubDate>Sun, 08 Mar 2009 03:23:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cascading Style Sheets]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=90</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/link_styles1.jpg" alt="link_styles1" title="link_styles1" width="190" height="151" class="alignleft size-full wp-image-253" />Cool new says to style links! Move beyond the boring old underline or color change to signify a link.  Let's get spicy!]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/link_styles1.jpg" alt="link_styles1" title="link_styles1" width="190" height="151" class="alignleft size-full wp-image-253" />We all know the traditional css styles for hyperlink manipulation.  The anchor pseudo-classes are great for adding small embelishments here and there, but there are a few other pretty cool techniques that can be put to use to really spice up our links.</p>
<p>It is difficult to tell just where a link is going to take you, or if it is going to open a specific file, etc.    </p>
<p>There is a way to inform your guests of the intentions of your links  with CSS.  You can easily add an icon near your link to give your guests an idea of its intentions.  </p>
<p>You simply add a class to any external links and in the css you give it a background url to display an external links indicator icon of your choice.  I&#8217;m assuming you know how to create an anchor element and give it a class?  If you don&#8217;t then I don&#8217;t feel sorry for you.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.external</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/externalicon.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This conveniently places a little icon to the right of the link, indicating that this is going to take you to an external website.  We make room for the icon by adding a 10px pad to the right of the anchor tag&#8217;s contents.  Try it!  You&#8217;ll dig it!</p>
<p>If you like that, check this shit out!  Attribute selectors allow you to target an element based on the existence or value of an attribute.  Pretty basic.  But what about substring matching attribute selectors?  What?  You heard me!  </p>
<p>These babies allow you to target an element by matching up the value of the attribute (or part of it!) with text that you supply.  Not sure what I mean?  Example&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href<span style="color: #00AA00;">^=</span><span style="color: #ff0000;">&quot;http:&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/externalicon.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This little snippet will place the icon just as it did in the previous example.  The way this does it though it target every anchor element with and href that starts with &#8220;http:&#8221; thus designating it as an external link.  Sweet!  Of course if you use absolute urls to any pages in your site this will affect those as well.  You&#8217;ll have to figure out how to deal with that little problem.  </p>
<p>You can do the same thing for &#8220;mailto:&#8221; links using the following&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href<span style="color: #00AA00;">^=</span><span style="color: #ff0000;">&quot;mailto:&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/email.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>You can do the same thing for &#8220;aim:&#8221; links using the following&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href<span style="color: #00AA00;">^=</span><span style="color: #ff0000;">&quot;aim:&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/aim.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>How about giving your users a heads up that the link points to some sort of a downloadable document like a .pdf, .doc, or .xls file? This can be accomplished with the attribute selector [att$=val], which targets attributes that end in a particular value such as .pdf, .doc, or .xls.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.pdf&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/pdf.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
&nbsp;
a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.doc&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/doc.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
&nbsp;
a<span style="color: #00AA00;">&#91;</span>href$<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.xls&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/xls.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>The only indicator as to what these links are is the little icon that is added via the css.  This can be accomplished in a myriad of ways, but this is just a bit more cool.  And it&#8217;s a neat little trick the way it targets the elements in a variety of ways.</p>
<p>Peace!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=90</wfw:commentRss>
		</item>
		<item>
		<title>Enable form fields</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=85</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=85#comments</comments>
		<pubDate>Sat, 07 Mar 2009 03:03:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=85</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/formfields.jpg" alt="formfields" title="formfields" width="190" height="151" class="alignleft size-full wp-image-257" />A great way to prevent a user from data input without acknowledging your terms and conditions...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/formfields.jpg" alt="formfields" title="formfields" width="190" height="151" class="alignleft size-full wp-image-257" />If you do not want the end user to input information into your form until they agree to a condition, waiver, agreement, etc., you can simply disable the form fields until the user checks a box stating that they agree with the terms and conditions.  This event handler calls a javascript function that enables the input fields allowing the user to supply their info.  Check it out!</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
<span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> enableField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
document.<span style="color: #660066;">input</span>.<span style="color: #660066;">dob</span>.<span style="color: #660066;">disabled</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">input</span>.<span style="color: #660066;">idnumber</span>.<span style="color: #660066;">disabled</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">input</span>.<span style="color: #660066;">submit</span>.<span style="color: #660066;">disabled</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">input</span>.<span style="color: #660066;">reset</span>.<span style="color: #660066;">disabled</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
chkbox.<span style="color: #660066;">disabled</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
&lt;/head&gt;
&lt;body&gt;
&nbsp;
&lt;input type=&quot;checkbox&quot; name=&quot;chkbox&quot; onclick=&quot;javascript:enableField();&quot;&gt;
    I agree to the TTECA Third Party Agreement&lt;br /&gt;
    &lt;form name=&quot;input&quot; method=&quot;post&quot; 
action=&quot; &quot;&gt;     
  &lt;p&gt;&lt;label for=&quot;dob&quot;&gt;&lt;strong&gt;Date of Birth:&lt;/strong&gt; &lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;dob&quot; id=&quot;dob&quot; disabled=&quot;true&quot;/&gt;
    &lt;strong&gt;(i.e. 03/10/1969 or 12/11/1970)&lt;/strong&gt;&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;label for=&quot;idnumber&quot;&gt;&lt;strong&gt;ID Number:&lt;/strong&gt; &lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;idnumber&quot; id=&quot;idnumber&quot; disabled=&quot;true&quot;/&gt;&lt;/p&gt;
&nbsp;
&lt;p&gt;&lt;input type=&quot;reset&quot; name=&quot;reset&quot; value=&quot;reset&quot; disabled=&quot;true&quot;/&gt; 
  &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot; disabled=&quot;true&quot;/&gt;&lt;/p&gt;
&nbsp;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Each of our form fields above start out with an attribute/value pair of disabled=&#8221;true&#8221;.  This means these form fields are disabled when the page is loaded; they are not active and therefore cannot accept any user interaction.  There is a checkbox that has the purpose of allowing the user to agree to the terms and conditions (or whatever you may have in this sense) by checking the checkbox.</p>
<p>When the user checks the box, the checkbox has an event handler attached to it&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;chkbox&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript:enableField();&quot;</span><span style="color: #339933;">&gt;</span></pre></div></div>

<p>When clicked the event will trigger the javascript function &#8220;enableField()&#8221; and all the form field elements will become active; that is they will now have a attribute/value pair of disabled=&#8221;false&#8221;.  The checkbox will also be changed to an attr/value pair of disabled=&#8221;true&#8221;, so that it cannot be checked again.</p>
<p>Yeah, no problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=85</wfw:commentRss>
		</item>
		<item>
		<title>onClick=Hide/Show a Div</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=80</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=80#comments</comments>
		<pubDate>Sat, 07 Mar 2009 02:06:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=80</guid>
		<description><![CDATA[A simple event handler and function to toggle the visibility of a div tag and its contents...]]></description>
			<content:encoded><![CDATA[<p>Ahh, Javascript; you mysterious bitch. Here&#8217;s a cool one that uses a simple function paired with an event handler assigned to a radio button to hide or make visible a div tag and its contents.  Note there are two sets of functions and two ways to target those sets.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html xmlns<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Content-Type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Untitled Document<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #006600; font-style: italic;">//this is the first set of functions</span>
<span style="color: #003366; font-weight: bold;">function</span> hidediv<span style="color: #009900;">&#40;</span>boxid<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>boxid<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'hidden'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> showdiv<span style="color: #009900;">&#40;</span>boxid<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>boxid<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'visible'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//this is the second set of functions</span>
<span style="color: #003366; font-weight: bold;">function</span> hidediv2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//single or double quotes do not matter in javascript. I like to use single quotes for</span>
<span style="color: #006600; font-style: italic;">//all things javascript and double quotes for all things html</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'yo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'hidden'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> showdiv2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'yo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span><span style="color: #339933;">=</span><span style="color: #3366CC;">'visible'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body <span style="color: #000066;">onload</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hidediv2()&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>form <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;form&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;form&quot;</span> action<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span> method<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span><span style="color: #000066; font-weight: bold;">This</span> first pair targets the first set of functions above<span style="color: #339933;">--&gt;</span>
Hide<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sh&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hide&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;1&quot;</span> onClick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hidediv('yo')&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br<span style="color: #339933;">/&gt;</span>
Show<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sh&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;show&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;2&quot;</span> onClick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;showdiv('yo')&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>p<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span><span style="color: #000066; font-weight: bold;">This</span> second pair targets the second set of functions above<span style="color: #339933;">--&gt;</span>
Hide<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sh&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hide&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;1&quot;</span> onClick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hidediv2()&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br<span style="color: #339933;">/&gt;</span>
Show<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;radio&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sh&quot;</span> id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;show&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;2&quot;</span> onClick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;showdiv2()&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>p<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;yo&quot;</span><span style="color: #339933;">&gt;</span>Now you see me<span style="color: #339933;">,</span> soon you won<span style="color: #3366CC;">'t!&lt;/div&gt;&lt;/p&gt;
&nbsp;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</span></pre></div></div>

<p>Freakin&#8217; sweet!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=80</wfw:commentRss>
		</item>
		<item>
		<title>CSS: An Introduction</title>
		<link>http://www.e3webdesigns.com/wordpress/?p=60</link>
		<comments>http://www.e3webdesigns.com/wordpress/?p=60#comments</comments>
		<pubDate>Thu, 05 Mar 2009 02:51:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cascading Style Sheets]]></category>

		<guid isPermaLink="false">http://www.e3webdesigns.com/wordpress/?p=60</guid>
		<description><![CDATA[<img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/css.jpg" alt="css" title="css" width="190" height="151" class="alignleft size-full wp-image-255" />A brief introduction to the wonderful world of CSS.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.e3webdesigns.com/wordpress/wp-content/uploads/2009/03/css.jpg" alt="css" title="css" width="190" height="151" class="alignleft size-full wp-image-255" />So here we find ourselves in the world of CSS.  This is one of my favorite technologies yet it is also one that I have yet to fully understand and ultimately master.  So let&#8217;s get to it.</p>
<p>What is CSS?  It&#8217;s a nifty little technology that basically dresses up a markup language such as (x)HTML.  If you want to get really detailed it&#8217;s a style sheet language which is a computer language that describes the presentation of structured or &#8220;well formed&#8221; documents, again such as (x)HTML.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
body
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#F9F9F7</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/a1.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">11px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Georgia<span style="color: #00AA00;">,</span> &amp;quot<span style="color: #00AA00;">;</span>Times New Roman&amp;quot<span style="color: #00AA00;">;,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So what the hell is all that?  What you see above is HTML and CSS presented in the same document for brevity, but it must be understood that HTML should be nested in the <body> tags of a valid (x)HTML document, and CSS should be placed in the <head> tag of that document or properly mapped to if it is to be external to the document (more on that later).</p>
<p>HTML elements provide meaning both to the browser and to the CSS style rules that manipulate them.  What are HTML elements?  Paragraphs, headings, anchors, divs, lists, etc.  All of the HTML elements tell the browser what to do with the content that they contain.  CSS uses these elements as targets for it&#8217;s style rules, and the result allows the designer to separate the content from the presentation of the content.  Otherwise it would most likely end up a big old mess.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.e3webdesigns.com/wordpress/?feed=rss2&amp;p=60</wfw:commentRss>
		</item>
	</channel>
</rss>
