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

<channel>
	<title>JasonLau.biz</title>
	<atom:link href="http://jasonlau.biz/home/feed" rel="self" type="application/rss+xml" />
	<link>http://jasonlau.biz/home</link>
	<description>Homepage Of Jason Lau</description>
	<lastBuildDate>Thu, 18 Mar 2010 12:17:38 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Better Form &#8211; A jQuery Plugin</title>
		<link>http://jasonlau.biz/home/jquery/a-better-form-a-jquery-plugin</link>
		<comments>http://jasonlau.biz/home/jquery/a-better-form-a-jquery-plugin#comments</comments>
		<pubDate>Fri, 05 Mar 2010 23:27:30 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://jasonlau.biz/home/?p=343</guid>
		<description><![CDATA[ 
  
    Plugin Description
    Download
    Options
    Examples 
    Issues   
  
  
A Better Form is a plugin I made for jQuery to help reduce spam comments, 
spam emails and other automated form submissions. 

A [...]]]></description>
			<content:encoded><![CDATA[<div id="abetterform-docs"> 
  <ul>
    <li><a href="#description">Plugin Description</a></li>
    <li><a href="#download">Download</a></li>
    <li><a href="#options">Options</a></li>
    <li><a href="#examples">Examples</a></li> 
    <li><a href="#issues">Issues</a></li>   
  </ul>
<div id="description" style="padding-bottom: 40px;">  
<strong><em>A Better Form</em></strong> is a plugin I made for jQuery to help reduce spam comments, 
spam emails and other automated form submissions. <br />
<br />
<strong><em>A Better Form</em></strong> allows you to omit certain attributes from HTML forms which are frequently targeted by spam-bots, such as the form tag and name attributes in form elements.
	<br />
	<br />
	<strong><em>A Better Form</em></strong> is easy to use. Just follow a few simple 
rules when you create your HTML forms:<br />
<ol>
	<li>Do not use the form tag.</li>
	<li>Use the id attribute instead of the name attribute for all form objects.</li>
	<li>Use a push button or image button instead of the submit type. The button 
	you use must have the class <em>absubmit</em>.</li>
</ol>
</div>
    <!-- End Main Tab -->
    
    <!-- Begin Download Tab -->
<div id="download" style="padding-bottom: 40px;"> 
<strong>Download The Source Code:</strong>
<a rel="attachment wp-att-348" href="http://jasonlau.biz/home/jquery/a-better-form-a-jquery-plugin/attachment/jquery-abetterform-js">jquery.abetterform.js</a>
<br />
<strong>Version:</strong> 1.0.6<br />
<br />
<span class="style1"><strong>Changelog</strong></span> <br />
<ul>
<li>3-18-2010 &#8211; 1.0.6 &#8211; Fixed bug which caused hidden fields to not have a name. Added <em>filtertext</em> and <em>textfilters</em> options. See the options tab for more info.</li>
<li>3-17-2010 &#8211; 1.0.5 &#8211; Fixed bug which caused hidden fields to be disabled.</li>
<li>3-16-2010 &#8211; 1.0.4 &#8211; Both <em>keyup</em> and <em>change</em> events are now used for textareas and text fields.</li>
<li>3-14-2010 &#8211; 1.0.3 &#8211; Fixed a bug which caused all form fields on the page, including those outside of the specified object, to be disabled.</li>
<li>3-14-2010 &#8211; 1.0.2 &#8211; Added the following options: sequential_disable, pluggable, serialized, multipart, clickonce . Refer to the Options tab for more information on those options.</li>	
<li>3-10-2010 &#8211; 1.0.1 &#8211; Fixes a typo which caused default form method to be invalid.</li>	
<li>3-5-2010 &#8211; 1.0.0 &#8211; Initial release</li>
</ul>	

</div>
    <!-- End Download Tab -->
    
    <!-- Begin Options Tab -->
<div id="options" style="padding-bottom: 40px;"> 
<strong><em>A Better Form</em></strong> has the following options:
<ul>
	<li><strong>attributes</strong>: The attributes option holds any form attributes you 
would normally use in a form tag. However, this option is not required. If the attributes option is omitted, the form will POST by default and the parent page will be the form-action target.
<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">
$(&quot;#form-container&quot;).abform({<br />
attributes :&#39;id=&quot;testing&quot; action=&quot;index.html&quot; method=&quot;POST&quot;&#39;<br />
});
</div>
<br /><br /></li>
        <li><strong>clickonce</strong>: Disable the submit button after the user clicks on it. This prevents multiple clicks. 
<ul>
	<li>true (default)</li>
	<li>false</li>
</ul>
<br /><br />
</li>
        <li><strong>multipart</strong>: Is it a multipart form? This is simply a shortcut to typing it into the form attributes. You cannot use the serialized option for forms which use the file select field. jQuery does not serialize the file select field.
<ul>
	<li>false (default)</li>
	<li>true</li>
</ul><br /><br /></li>
	<li><strong>sequential_disable</strong>: &#8220;<em>Sequential Disable</em>&#8221; is a term I use to describe my method of disabling form objects in sequence depending upon their values. For example, if a form field is empty, all fields below it are disabled automatically. Each field is enabled in sequence if the field before it has a value.
<ul>
	<li>true (default)</li>
	<li>false</li>
</ul><br /><br /></li>
        <li><strong>pluggable</strong>: This option lets you plug-in to <strong><em>A Better Form</em></strong> with your own function. Instead of the using the default submit action, you can use your own function to handle the form data. <strong><em>A Better Form</em></strong> will automatically serialize the form data and send it back to your function. From there you can parse it, validate it, submit it, or whatever.<br /><br /></li>
 	<li><strong>serialized</strong>: This disables the form serialization for the pluggable option.
<ul>
	<li>true (default)</li>
	<li>false</li>
</ul>
<br />
<br />
</li>

<li><strong>filtertext</strong>: Apply text filters to each text field or text area.
<ul>
	<li>true (default)</li>
	<li>false</li>
</ul>
<br />
<br />
</li>	

<li><strong>textfilters</strong>: A comma separated list of filters which will be automatically removed from text fields as the user types. Here is the default filters setting:
<ul>
	<li>&#8216;url=,link=,http:,www.,href,<a'</li>
</ul>
<br />
<br />
</li>	
	
</ul>

There are two classes which are associated with <strong><em>A Better Form</em></strong>:
<ul>
<li><strong>absubmit</strong> &#8211; This class must be used to define the form submit button object. The submit button can be any object provided you assign it this class. See the examples tab.</li>
<li><strong>aboptgroup</strong> &#8211; This class must be used for the html optgroup tag because the optgroup label is defined in the id attribute. See the examples tab.</li>
</ul>
</div>
<!-- End Options Tab -->

<!-- Begin Examples Tab -->
<div id="examples" style="padding-bottom: 40px;">
Here is a working demonstration: <a href="http://jasonlau.biz/jquery.abetterform/" target="_blank">http://jasonlau.biz/jquery.abetterform/</a><br /><br />
Here is the easiest method for using <em><strong>A Better Form</strong></em>:<br />
<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">
$(&quot;#form-container&quot;).abform();
</div>

Here is an example of how a form can be coded:<br />
<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">
&lt;div id=&quot;form-container&quot;&gt;<br />
Email: &lt;input id=&quot;email&quot; /&gt;&lt;br /&gt;<br />
Comment:&lt;br /&gt;<br />
&lt;textarea id=&quot;comment&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;<br />
&lt;input type=&quot;button&quot; class=&quot;absubmit&quot; value=&quot;Submit&quot; /&gt;<br />
&lt;/div&gt;
</div>
As you can see, there is no form tag. Instead, I have used a div tag with the id <em>form-container</em> for example.<br />
In each of my form elements, I used the id attribute instead of 
using the name attribute.<br />
The submit button is actually a push button with the required class <em>absubmit</em>. 
<br />
You can use any element you want for the submit button as long as you give it 
the class <em>absubmit</em>.<br />
	<br />
And now the javascript code for <strong><em>A Better Form:</em></strong><br />
<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">
&lt;script type=&quot;text/javascript&quot;&gt;<br />
jQuery(document).ready(function () {<br />
	<br />
$(&quot;#form-container&quot;).abform({<br />
attributes :&#39;id=&quot;testing&quot; action=&quot;index.html&quot; method=&quot;POST&quot;&#39;<br />
});<br />
	<br />
});<br />
&lt;/script&gt;
</div>
<br />
	<br />
	If you use the optgroup tag in select menus, use the id attribute in 
	place of the label attribute. Also, it must be assigned the class <em>
	aboptgroup</em>.<br />
	<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">&lt;optgroup id=&quot;This is the group!&quot; class=&quot;aboptgroup&quot;&gt;<br />
	&lt;option value=&quot;1&quot;&gt; Option 1&lt;/option&gt;<br />
	&lt;option value=&quot;2&quot;&gt;Option 2&lt;/option&gt;<br />
	&lt;option value=&quot;3&quot;&gt;Option 3&lt;/option&gt;<br />
	&lt;/optgroup&gt;
	</div>
        The <em>pluggable</em> option allows you to plug-in to <em><strong>A Better Form</strong></em> with your own callback function. The form data is automatically (and optionally) serialized and sent back to your function for processing.<br />
Here is an example of using the <em>pluggable</em> option:
<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">&lt;script type=&quot;text/javascript&quot;&gt;<br />
&lt;!&#8211;<br />
var myFunction = function(serialized){<br />
alert(serialized);<br />
}<br />
<br />
jQuery(document).ready(function () {<br />
$(&quot;#myform&quot;).abform({<br />
attributes :&#8217;id=&quot;testing&quot; action=&quot;index.html&quot; method=&quot;POST&quot;&#8217;,<br />
pluggable : myFunction,<br />
serialized : true,<br />
multipart : false,<br />
clickonce : true<br />
}); <br />
});<br />
//&#8211;&gt;<br />
&lt;/script&gt; 
	</div>
In this example, instead of submitting the form when the form button is clicked, <em><strong>A Better Form</strong></em> serializes the form data and sends it to the custom callback function named <em>myFunction</em>.
</div>
<!-- End Examples Tab -->

<!-- Begin Issues Tab -->
<div id="issues" style="padding-bottom: 40px;">
<em><strong>A Better Form</strong></em> is known to have the following issues:
<ul>
	<li>All form fields within the specified object are affected by <em><strong>A Better Form</strong></em>. This means that you should not attempt to nest forms inside each other. For example, do not place a Pay-Pal button inside the same object you are using <em><strong>A Better Form</strong></em> on or neither the Pay-Pal button or the form will function properly. Keep the forms separate.</li>
        <li>jQuery does not serialize the File form field, so when using multipart forms, be sure to set the serialized option to false.</li>
</ul>
<p>Please report any errors or other issues by using the <a href="http://jasonlau.biz/home/contact-me">Contact Form</a>.</p>
</div>
</div>

<script type="text/javascript">
jQuery(function(){
    jQuery("#abetterform-docs").tabs();
});	
</script>]]></content:encoded>
			<wfw:commentRss>http://jasonlau.biz/home/jquery/a-better-form-a-jquery-plugin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vice Versa &#8211; Convert Pages To Posts And Vice Versa &#8211; WordPress Plugin</title>
		<link>http://jasonlau.biz/home/wordpress/convert-pages-to-posts-vice-versa</link>
		<comments>http://jasonlau.biz/home/wordpress/convert-pages-to-posts-vice-versa#comments</comments>
		<pubDate>Wed, 03 Mar 2010 03:17:17 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jasonlau.biz/home/?p=317</guid>
		<description><![CDATA[Vice Versa is a plugin I wrote for WordPress. Vice Versa allows you to easily convert WordPress Posts to Pages and Pages to Posts. You can also assign a Page or Post a parent or category(s) as you are converting from one to the other. Vice Versa is easy to install and use.


Download Vice Versa:
Version [...]]]></description>
			<content:encoded><![CDATA[<strong>Vice Versa</strong> is a plugin I wrote for WordPress. Vice Versa allows you to easily convert WordPress Posts to Pages and Pages to Posts. You can also assign a Page or Post a parent or category(s) as you are converting from one to the other. Vice Versa is easy to install and use.
<br />
<br />
<strong>Download Vice Versa:</strong><br />
Version 1.0<br />
<ul>
	<li><a rel="attachment wp-att-324" href="http://jasonlau.biz/home/wordpress/convert-pages-to-posts-vice-versa/attachment/vice-versa">vice-versa.zip</a></li>
	<li><a href="http://jasonlau.biz/public/vice-versa/vice-versa.rar">vice-versa.rar</a></li>
</ul>
<strong>Installation:</strong><br />
<ol>
	<li>Unzip vice-versa.zip.</li>
	<li>Upload the folder named &#8216;vice-versa&#8217; to the wp-content/plugins directory on your server.</li>
	<li>Go to the plugins manager in your Wordpress Dashboard, locate Vice Versa in the list of plugins (under &#8216;V&#8217; for &#8216;Vice Versa&#8217;), and click Activate.</li>
	<li>Done!</li>
</ol>
No database tables are affected and there are no additional settings required for the plugin to work.
<br /><br />
Once the plugin is activated, you will find <em>Vice Versa</em> in the Dashboard menu under <em>Settings</em>.
<br /><br />
<strong>Screenshot:</strong><br />
<div id="attachment_321" class="wp-caption alignnone" style="width: 495px"><a rel="attachment wp-att-321" href="http://jasonlau.biz/home/wordpress/convert-pages-to-posts-vice-versa/attachment/screenshot-1-2"><img class="size-full wp-image-321" title="Vice Versa Screenshot" src="http://jasonlau.biz/home/wp-content/uploads/2010/03/screenshot-11.png" alt="Vice Versa Screenshot" width="485" height="674" /></a><p class="wp-caption-text">Vice Versa Screenshot</p></div>]]></content:encoded>
			<wfw:commentRss>http://jasonlau.biz/home/wordpress/convert-pages-to-posts-vice-versa/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam-less And Robot-less Forms With jQuery</title>
		<link>http://jasonlau.biz/home/jquery/spam-less-and-robot-less-forms-with-jquery</link>
		<comments>http://jasonlau.biz/home/jquery/spam-less-and-robot-less-forms-with-jquery#comments</comments>
		<pubDate>Sat, 27 Feb 2010 18:05:19 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[anti]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[automated]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[posting]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spam-bot]]></category>
		<category><![CDATA[spambot]]></category>
		<category><![CDATA[spammer]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[submission]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://jasonlau.biz/home/?p=269</guid>
		<description><![CDATA[Are you trying to figure out how to reduce or eliminate spam on your website email or comment forms?

My website was slammed by spammers on a daily basis. Typically, the spam attacks would be from robots that would root-out the form fields on each webpage and then automate form submissions which were loaded with spam.

I [...]]]></description>
			<content:encoded><![CDATA[Are you trying to figure out how to reduce or eliminate spam on your website email or comment forms?
<br /><br />
My website was slammed by spammers on a daily basis. Typically, the spam attacks would be from robots that would root-out the form fields on each webpage and then automate form submissions which were loaded with spam.
<br /><br />
I created an easy solution that does not involve the use of annoying CAPTCHA security phrase generators or similar technology blunders.
<br /><br />
My idea does however require javascript and <a title="http://jquery.com - jQuery Home" href="http://jquery.com" target="_blank">jQuery</a>.
<br /><br />
The idea is simple &#8211; spam-bots cannot submit a form that does not exist. Nor can spam-bots use a form field which has no name. So, if you remove the form elements from the webpage you effectively stop the robots.
<br /><br />
How can I use a form that does not exist? That is easily done with jQuery. I&#8217;ll 
show you how. 
<ol>
  <li>Include jQuery in the HTML document&#8217;s &lt;head&gt; section before the &lt;/head&gt; 
    tag . 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      &lt;script src=&#8221;http://code.jquery.com/jquery-latest.js&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</div>
    <br />
  </li>
  <li>Add a &lt;noscript&gt; tag to your document body so visitors will know javascript 
    is needed to use the website. I found it&#8217;s best to add this tag to the end 
    of the HTML body so that it does not affect how your website is displayed 
    in search engine results. Adding it to the beginning may cause it to show 
    up as the description for your webpage in the search engine results. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">&lt;noscript&gt;Javascript 
      is required to view this webpage properly. Please enable javascript in your 
      browser settings.&lt;/noscript&gt;</div>
    <br />
  </li>
  <li>Create a div container for your form in your HTML document&#8217;s &lt;body&gt; 
    section before the &lt;/body&gt; tag. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">&lt;div 
      id=&#8221;form-container&#8221;&gt;&lt;/div&gt;</div>
    <br />
  </li>
  <li>Make a form inside the form-container div following these simple rules. 
    <ol>
      <li>When you make your form do not include the &lt;form&gt; tag. The form 
        tag is a target for robots.</li>
      <li>Rather than using the <em>name</em> attribute for each form field, use 
        the <em>id</em> attribute instead. The name attribute is another target 
        for robots.</li>
      <li>If you need to include a submit button in your form, use <em>type=button</em> 
        instead of <em>type=submit</em>.</li>
      <li>Add <em>disabled=&#8221;disabled&#8221;</em> to each form element except the first.</li>
    </ol>
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      &lt;strong&gt;Email:&lt;/strong&gt; &lt;input id=&#8221;email&#8221; /&gt;<br />
      &lt;strong&gt;Comment:&lt;/strong&gt;<br />
      &lt;textarea id=&#8221;comment&#8221; disabled=&#8221;disabled&#8221;&gt;&lt;/textarea&gt;<br />
      &lt;input type=&#8221;button&#8221; id=&#8221;sub-button&#8221; value=&#8221;Submit&#8221; disabled=&#8221;disabled&#8221; 
      /&gt;</div>
    <br />
  </li>
  <li>After the form is assembled, go back to the &lt;head&gt; section where the 
    script for the form will be placed.<br />
  </li>
  <li>Make a jQuery javascript block which will call jQuery on page load. The 
    form script will be placed where noted in the script below. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      &lt;script type=&#8221;text/javascript&#8221;&gt;<br />
      <br />
      $(document).ready(function () { <br />
      <br />
      // Form script goes here<br />
      <br />
      });<br />
      &lt;/script&gt; </div>
    <br />
  </li>
  <li>I am going to include some basic email address validation in this example 
    which will verify that the email field is actually an email address. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      var checkRegexp = function(o,regexp){<br />
      if(!(regexp.test(o.val()))){<br />
      return false;<br />
      } else {<br />
      return true;<br />
      }<br />
      };<br />
    </div>
    <br />
  </li>
  <li>I disabled most of the form fields in step 4-4 so the user must follow a 
    certain order while filling in form data. To make this work, I will make a 
    script to enable or disable each field based on user interaction. Basically, 
    if there is no data in field 1, field 2 is disabled. Field1 is not enabled 
    until field 2 value has changed and contains data, and so on. Also, this is 
    where I implement the email address validation. In this example, when the 
    email field is changed, the address is validated and the user is alerted if 
    validation fails. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      $(&#8220;#email&#8221;).change(function(){<br />
      if(!$(&#8220;#email-tip&#8221;).html()){<br />
      $(this).after(&#8216;&lt;div id=&#8221;email-tip&#8221; style=&#8221;display: none; background-color: 
      #FFFFFF;&#8221;&gt;Please enter a valid email address.&lt;/div&gt;&#8217;);<br />
      }<br />
      <br />
      if($(this).val() != &#8221; &amp;&amp; $(this).val() != &#8216; &#8216; &amp;&amp; !checkRegexp($(this),/^((([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i)) 
      {<br />
      $(&#8220;#comment&#8221;).attr(&#8216;disabled&#8217;,'disabled&#8217;);<br />
      $(&#8220;#email-tip&#8221;).show();<br />
      $(&#8220;#email-tip&#8221;).animate( { fontSize:&#8221;2em&#8221; } , 500 )<br />
      .animate( { fontSize:&#8221;1em&#8221; } , 500 ); <br />
      } else {<br />
      if($(&#8220;#email-tip&#8221;).attr(&#8216;display&#8217;) != &#8216;none&#8217;){<br />
      $(&#8220;#email-tip&#8221;).hide(&#8217;slow&#8217;);<br />
      }<br />
      $(&#8220;#comment&#8221;).attr(&#8216;disabled&#8217;,&#8221;);<br />
      }<br />
      });<br />
      <br />
      $(&#8220;#comment&#8221;).change(function(){<br />
      if($(this).val() != &#8221; &amp;&amp; $(this).val() != &#8216; &#8216;) {<br />
      $(&#8220;#sub-button&#8221;).attr(&#8216;disabled&#8217;,&#8221;);<br />
      } else {<br />
      $(&#8220;#sub-button&#8221;).attr(&#8216;disabled&#8217;,'disabled&#8217;);<br />
      }<br />
      });<br />
      <br />
    </div>
    <br />
  </li>
  <li>If you want to eliminate certain types of user input, such as html links 
    or bbcode links, here is a handy little addition I made just for that. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      $(&#8220;#comment&#8221;).bind(&#8220;keyup&#8221;,function(){<br />
      var comment_filters = ['url=','link=','http:','www.','href','&lt;a'];<br />
      var comment = $(&#8220;#comment&#8221;).val();<br />
      for(var i in comment_filters){<br />
      var checkit = comment.split(comment_filters[i]);<br />
      if(checkit.length &gt; 1){<br />
      $(&#8220;#comment&#8221;).val(checkit[0]);<br />
      }<br />
      }<br />
      });<br />
    </div>
    That script will basically erase the unwanted input AS the user attempts to 
    type it into the form. The offending input will simply disappear before their 
    very eyes. I have added a number of filters to the variable <em>comment_filters</em> 
    which will eliminate links from the user input. There is no limit to the number 
    of filters I can use. Of course, the user could always type in spaces between 
    each letter to post links, but they will not be click-able, followable, or 
    even copy/paste-able. Too much work for a spammer!<br />
    <br />
  </li>
  <li>Everything is ready now for the form submission script. Once the user has 
    appropriately filled in all of the form fields the submit button has been 
    enabled and the form is ready to submit.
<br />
In earlier steps I left out the form 
    tag, left out all of the <em>name</em> attributes, and made a regular button 
    instead of a submit button. Now I have to fix all of that, but only after 
    the user has actually interacted with the button. I will bind a <em>click</em> 
    function to the button object so that the user must use a mouse to manually 
    click the button; an action a spam-bot is unable to reproduce. This function 
    will wrap the form-container div with a form tag, will add the name attributes 
    to the input fields, and finally, will submit the form for processing. <br />
    <br />
    For each input, textarea, or select menu, this script will create a name attribute 
    by copying the id attribute for that object. This only takes place in the 
    <em>form-container</em> so it does not affect other forms on the same page. 
    <div class="code ui-state-highlight ui-corner-all" style="padding: 10px;"> 
      $(&#8220;#sub-button&#8221;).bind(&#8220;click&#8221;,function(){<br />
      $(&#8216;#form-container input, #form-container textarea, #form-container select&#8217;).each(function(){<br />
      $(this).attr(&#8216;name&#8217;,$(this).attr(&#8216;id&#8217;));<br />
      });<br />
      <br />
      $(&#8216;#form-container&#8217;).wrap(&#8216;&lt;form id=&#8221;comment-form&#8221; action=&#8221;#&#8221; method=&#8221;POST&#8221;&gt;&lt;/form&gt;&#8217;);<br />
      alert(&#8216;Your comment has been submitted!&#8217;);<br />
      $(&#8220;#comment-form&#8221;).submit();<br />
      });<br />
    </div>
  </li>
  <li>Save.</li>
</ol>
So, as you can see, I have created a form that is not really a form at all. My 
form is lacking the elements that spam-bots rely upon for automated submissions. 
My method will eliminate most if not all of the automated form submissions on 
your website. <br />
<br />
<strong>Here is the complete, working code:</strong>
<div class="code ui-state-highlight ui-corner-all" style="padding: 10px;">
&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;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;<br />
<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;<br />
&lt;meta name=&quot;author&quot; content=&quot;Jason Lau&quot; /&gt;<br />
<br />
&lt;title&gt;JasonLau.biz Robot-less And Spam-less Forms With jQuery&lt;/title&gt;<br />
&lt;script src=&quot;http://jasonlau.biz/javascript/jquery/latest/jquery-latest.js&quot; 
type=&quot;text/javascript&quot;&gt;&lt;/script&gt; <br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
&lt;!&#8211;<br />
/* Spam-less Robot-less Forms Example &#8211; (c)2010 JasonLau.biz */<br />
$(document).ready(function(){<br />
var checkRegexp = function(o,regexp){<br />
if(!(regexp.test(o.val()))){<br />
return false;<br />
} else {<br />
return true;<br />
}<br />
};<br />
<br />
$(&quot;#email&quot;).change(function(){<br />
if(!$(&quot;#email-tip&quot;).html()){<br />
$(this).after(&#39;&lt;div id=&quot;email-tip&quot; style=&quot;display: none; background-color: 
#FFFFFF;&quot;&gt;Please enter a valid email address.&lt;/div&gt;&#39;);<br />
}<br />
if($(this).val() != &#39;&#39; &amp;&amp; $(this).val() != &#39; &#39; &amp;&amp; !checkRegexp($(this),/^((([a-z]|\d|[!#\$%&amp;&#39;\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&amp;&#39;\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i)) 
{<br />
$(&quot;#comment&quot;).attr(&#39;disabled&#39;,&#39;disabled&#39;);<br />
$(&quot;#email-tip&quot;).show();<br />
$(&quot;#email-tip&quot;).animate({ fontSize:&quot;2em&quot; },500)<br />
.animate({ fontSize:&quot;1em&quot; },500);<br />
} else {<br />
if($(&quot;#email-tip&quot;).attr(&#39;display&#39;) != &#39;none&#39;){<br />
$(&quot;#email-tip&quot;).hide(&#39;slow&#39;);<br />
}<br />
$(&quot;#comment&quot;).attr(&#39;disabled&#39;,&#39;&#39;);<br />
}<br />
});<br />
<br />
$(&quot;#comment&quot;).change(function(){<br />
if($(this).val() != &#39;&#39; &amp;&amp; $(this).val() != &#39; &#39;){<br />
$(&quot;#sub-button&quot;).attr(&#39;disabled&#39;,&#39;&#39;);<br />
} else {<br />
$(&quot;#sub-button&quot;).attr(&#39;disabled&#39;,&#39;disabled&#39;);<br />
}<br />
});<br />
<br />
$(&quot;#comment&quot;).bind(&quot;keyup&quot;,function(){<br />
<br />
var comment_filters = [&#39;url=&#39;,&#39;link=&#39;,&#39;http:&#39;,&#39;www.&#39;,&#39;href&#39;,&#39;&lt;a&#39;];<br />
<br />
var comment = $(&quot;#comment&quot;).val();<br />
for(var i in comment_filters){<br />
var checkit = comment.split(comment_filters[i]);<br />
if(checkit.length &gt; 1){<br />
$(&quot;#comment&quot;).val(checkit[0]);<br />
}<br />
}<br />
});<br />
<br />
$(&quot;#sub-button&quot;).bind(&quot;click&quot;,function(){<br />
$(&#39;#form-container input, #form-container textarea, #form-container 
select&#39;).each(function(){ <br />
$(this).attr(&#39;name&#39;,$(this).attr(&#39;id&#39;));<br />
});<br />
$(&#39;#form-container&#39;).wrap(&#39;&lt;form id=&quot;comment-form&quot; action=&quot;#&quot; 
method=&quot;POST&quot;&gt;&lt;/form&gt;&#39;);<br />
alert(&#39;Your comment has been submitted!&#39;);<br />
$(&quot;#comment-form&quot;).submit();<br />
<br />
});<br />
});<br />
&#8211;&gt; <br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
<br />
&lt;body&gt;<br />
<br />
&lt;div id=&quot;form-container&quot;&gt;<br />
&lt;strong&gt;Email:&lt;/strong&gt; &lt;input id=&quot;email&quot; /&gt;&lt;br /&gt;<br />
&lt;strong&gt;Comment:&lt;/strong&gt;&lt;br /&gt;<br />
&lt;textarea id=&quot;comment&quot; disabled=&quot;disabled&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;<br />
&lt;input type=&quot;button&quot; id=&quot;sub-button&quot; value=&quot;Submit&quot; disabled=&quot;disabled&quot; /&gt;<br />
&lt;/div&gt;<br />
<br />
&lt;noscript&gt;Javascript is required to view this webpage properly. Please enable 
javascript in your browser settings.&lt;/noscript&gt; <br />
<br />
&lt;/body&gt;<br />
&lt;/html&gt;
</div>]]></content:encoded>
			<wfw:commentRss>http://jasonlau.biz/home/jquery/spam-less-and-robot-less-forms-with-jquery/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SwishMax Dynamic Right-Click Context Menu Example</title>
		<link>http://jasonlau.biz/home/swishmax/swishmax-dynamic-right-click-context-menu-example</link>
		<comments>http://jasonlau.biz/home/swishmax/swishmax-dynamic-right-click-context-menu-example#comments</comments>
		<pubDate>Sat, 19 Dec 2009 14:00:22 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SwishMax]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[contekst]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[customize]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[enable]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[item]]></category>
		<category><![CDATA[items]]></category>
		<category><![CDATA[max]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[mouse-click]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[right-click]]></category>
		<category><![CDATA[rightclick]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[swish]]></category>

		<guid isPermaLink="false">http://jasonlau.biz/home/?p=77</guid>
		<description><![CDATA[
 google_ad_client = 'pub-8339548926689039'; google_ad_width = 468; google_ad_height = 15; google_ad_format = '468x15_0ads_al'; google_ad_channel = ''; google_color_border = '000000'; google_color_bg = '171717'; google_color_link = 'CCCCCC'; google_color_text = '000000'; google_color_url = 'EEEEEE';







	
	Right-Click Image For Music Playlist And Player Controls




In this SwishMax 3 example, I have created a dynamic right-click context menu on-the-fly from a playlist array. [...]]]></description>
			<content:encoded><![CDATA[<script type="'text/javascript'">
 google_ad_client = 'pub-8339548926689039'; google_ad_width = 468; google_ad_height = 15; google_ad_format = '468x15_0ads_al'; google_ad_channel = ''; google_color_border = '000000'; google_color_bg = '171717'; google_color_link = 'CCCCCC'; google_color_text = '000000'; google_color_url = 'EEEEEE';
</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="'text/javascript'"></script>
<div id="drc-example-container">
<table align="center" id="drc-example-body" class="ui-widget-content ui-corner-all">
<tr>
<td align="center" style="width:250px; padding:10px 10px 10px 10px;">
<div id="drc-example-player">
</div>
	<br />
	Right-Click Image For Music Playlist And Player Controls</div>
</td>
</tr>
</table>
<div id="drc-example-description">
In this SwishMax 3 example, I have created a dynamic right-click context menu on-the-fly from a playlist array. Each context menu item has a unique function assigned to it. I do this by utilizing the context menu item&#8217;s caption.
	<br /><br />I made an opensource music player which utilizes my dynamic context menu idea as an example.

The SwishMax 3 swi is attached to this post.
<br /><br />Attached File(s) <a href="http://forums.swishzone.com/index.php?act=attach&#038;type=post&#038;id=40018" target="_blank">dynamic_context_menu_playlist.swi</a> ( 16.72K )</div>
<script type="text/javascript">
$(function(){
$("#drc-example-player").jlEmbed({
 params: 'url=http://jasonlau.biz/public/examples/dynamic_context_menu_playlist/index.swf?test=1 width=100 height=100  plugin=adobeflash'
});
$('#drc-example-container').show("slow");	
});
</script>]]></content:encoded>
			<wfw:commentRss>http://jasonlau.biz/home/swishmax/swishmax-dynamic-right-click-context-menu-example/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
