<?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>Hot Scripts Blog &#187; JavaScript</title>
	<atom:link href="http://www.hotscripts.com/blog/category/tutorials/javascript-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hotscripts.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 12:18:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Meet LESS, The Dynamic Stylesheet Language</title>
		<link>http://www.hotscripts.com/blog/meet-dynamic-stylesheet-language/</link>
		<comments>http://www.hotscripts.com/blog/meet-dynamic-stylesheet-language/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 12:40:13 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[Around the Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=1995</guid>
		<description><![CDATA[LESS is a JavaScript based CSS preprocessor which allows you to write CSS in its extended syntax and it will automatically compile that code into normal CSS.<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/meet-dynamic-stylesheet-language/">Meet LESS, The Dynamic Stylesheet Language</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/raphael-javascript-vector-library/' rel='bookmark' title='Meet Raphaël, the JavaScript Vector Library'>Meet Raphaël, the JavaScript Vector Library</a></li>
<li><a href='http://www.hotscripts.com/blog/determining-programming-language-popularity/' rel='bookmark' title='Determining Programming Language Popularity'>Determining Programming Language Popularity</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Writing CSS is usually pretty straightforward &#8211; the syntax is simple and all you have to do is pick an HTML element, select a property and assign a value to it. However when coding CSS for complex designs, you will often see yourself writing a lot of repetitive rulesets or re-defining the same style for your markups. Obviously you could use the shorthand properties of CSS to save you some of the mundane coding, but to truly speed up your CSS development you probably need support of variables, nested rules or even functions.</p>
<p><a href="http://lesscss.org/"><img class="alignright size-full wp-image-1998" title="less-logo-large" src="http://www.hotscripts.com/blog/wp-content/uploads/2011/02/less-logo-large.png" alt="" width="199" height="81" /></a>If you want to stick to being DRY (don&#8217;t repeat yourself) for writing less code, then enter <a href="http://lesscss.org/">LESS</a>. LESS is a JavaScript based CSS preprocessor which allows you to write CSS in its extended syntax and it will automatically compile that code into normal CSS. Currently LESS supports variables, mixins, operations and nested rules.  Variables will allow you to define widely used values in a single place and then re-use them throughout the style sheet:</p>
<p><img class="aligncenter size-full wp-image-1996" title="less-example" src="http://www.hotscripts.com/blog/wp-content/uploads/2011/02/less-example.jpg" alt="" width="478" height="256" /></p>
<p>Each of these different dynamic behaviors are real time-savers and the best way to understand how they work is to refer to the site&#8217;s usage <a href="http://lesscss.org/#-client-side-usage">examples</a>.</p>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/meet-dynamic-stylesheet-language/">Meet LESS, The Dynamic Stylesheet Language</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/raphael-javascript-vector-library/' rel='bookmark' title='Meet Raphaël, the JavaScript Vector Library'>Meet Raphaël, the JavaScript Vector Library</a></li>
<li><a href='http://www.hotscripts.com/blog/determining-programming-language-popularity/' rel='bookmark' title='Determining Programming Language Popularity'>Determining Programming Language Popularity</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/meet-dynamic-stylesheet-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed up your Apps with Google’s AJAX Libraries</title>
		<link>http://www.hotscripts.com/blog/speed-apps-googles-ajax-libraries/</link>
		<comments>http://www.hotscripts.com/blog/speed-apps-googles-ajax-libraries/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 11:48:10 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[Around the Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=1986</guid>
		<description><![CDATA[Google offers what it calls, Google AJAX Libraries, a content delivery network (CDN) to serve popular JavaScript libraries from its data centers. <p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/speed-apps-googles-ajax-libraries/">Speed up your Apps with Google’s AJAX Libraries</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/google-introduces-webp-image-format/' rel='bookmark' title='Google Introduces WebP – a new image format'>Google Introduces WebP – a new image format</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-image-effects/' rel='bookmark' title='5 Amazing JavaScript Image Effects Libraries'>5 Amazing JavaScript Image Effects Libraries</a></li>
<li><a href='http://www.hotscripts.com/blog/10-great-html5-experiments-apps/' rel='bookmark' title='10 Great HTML5 Experiments and Apps'>10 Great HTML5 Experiments and Apps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hotscripts.com/blog/wp-content/uploads/2011/01/scriptsrc.jpg"><img class="alignright size-full wp-image-1988" title="scriptsrc" src="http://www.hotscripts.com/blog/wp-content/uploads/2011/01/scriptsrc.jpg" alt="" width="200" height="179" /></a>If  you use an open source JavaScript library like <a href="http://www.hotscripts.com/category/javascript/javascript-frameworks/jquery-plugins/">jQuery</a>, Mootools or  Prototype on your site, you’re likely hosting the .js files on your  server and calling them directly in your pages. This approach is good,  but there’s an even better way of getting your JavaScript libraries  served. Google offers what it calls, <a href="http://code.google.com/apis/libraries/">Google AJAX Libraries</a>, a content  delivery network (CDN) to serve popular JavaScript libraries from its  data centers. By having Google host and serve your JavaScript, you can  reap the following benefits:</p>
<ol>
<li><strong>Saves your bandwidth </strong>- You can save up to 50Kb per visitor in bandwidth by using Google’s CDN.</li>
<li><strong>Decrease latency</strong> &#8211; your visitors will be served by a CDN server closest to their physical location)</li>
<li><strong>Better caching</strong>- a visitor who accessed a previous site using Google’s hosted JS is likely to have a copy in his cache)</li>
</ol>
<p>There’s  also a handy online tool at <a href="http://www.Scriptsrc.net">Scriptsrc.net</a> that allows you to easily  copy and paste the latest version of your JavaScript library for  insertion on your page.</p>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/speed-apps-googles-ajax-libraries/">Speed up your Apps with Google’s AJAX Libraries</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/google-introduces-webp-image-format/' rel='bookmark' title='Google Introduces WebP – a new image format'>Google Introduces WebP – a new image format</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-image-effects/' rel='bookmark' title='5 Amazing JavaScript Image Effects Libraries'>5 Amazing JavaScript Image Effects Libraries</a></li>
<li><a href='http://www.hotscripts.com/blog/10-great-html5-experiments-apps/' rel='bookmark' title='10 Great HTML5 Experiments and Apps'>10 Great HTML5 Experiments and Apps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/speed-apps-googles-ajax-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Ext JS</title>
		<link>http://www.hotscripts.com/blog/started-ext-js/</link>
		<comments>http://www.hotscripts.com/blog/started-ext-js/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 05:59:42 +0000</pubDate>
		<dc:creator>Nuno Franco da Costa</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=1832</guid>
		<description><![CDATA[Ext JS is a cross-browser JavaScript library for building rich internet applications (RIA). In this tutorial, Nuno will teach you how to get started with Ext JS and walkthrough with you on creating simple dialog boxes and tooltips as well as integrating Ext JS with your form. <p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/started-ext-js/">Getting Started with Ext JS</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/' rel='bookmark' title='Client-side text field validation with Javascript'>Client-side text field validation with Javascript</a></li>
<li><a href='http://www.hotscripts.com/blog/cookies-with-javascript/' rel='bookmark' title='Cookies with JavaScript'>Cookies with JavaScript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h2 id="toc-what-is-ext-js">What is Ext JS?</h2>
<p>Ext started as an extension to <a href="http://developer.yahoo.com/yui/">YUI</a> , but since has evolved into a full framework., describing itself as being a &#8220;<em>cross-browser JavaScript library for building rich internet applications</em>&#8220;. While this description stands true, it is however too simple to describe this awesome JavaScript framework.</p>
<p>Ext is extremely powerful and well written. Its true Object oriented nature and design make it perfect for seasoned developers, compared to other mainstream frameworks. If want to create Rich Internet Applications (RIA) Ext is the tool to use: it has  an extremely complete GUI toolkit, providing you with tons of components that mimic desktop applications’ fluidity and complexity on the web. Just check <a href="http://dev.sencha.com/deploy/dev/examples/">Ext demo page</a>, I&#8217;m sure you will be dazzled by what you can achieve with it.</p>
<p>You can get Ext in two forms Ext Core and Ext JS.</p>
<ol>
<li><strong>Ext Core </strong>is the &#8220;lite version&#8221; of Ext JS, offering the same kind of functionality as other popular JS frameworks. It’s licensed under the very permissive MIT license. As you might have guessed the GUI components are not included in the Core.</li>
<li><strong>Ext JS</strong> comes with a lot of extra features and lots of GUI gadgets. You can get it under one of the two licenses: under a GPL or a commercial license that waives the GPL restrictions.</li>
</ol>
<p>Ext (both Core and JS) is <a href="http://dev.sencha.com/deploy/ext/docs/">well documented</a> and feature a wide variety of <a href="http://dev.sencha.com/deploy/ext/examples/">demos</a> and an easy to follow <a href="http://www.sencha.com/products/core/manual/">manual</a> . It also has great <a href="http://www.sencha.com/forum/">support community</a>.</p>
<p>In this article we&#8217;ll teach you how to get started with Ext JS.</p>
<h2 id="toc-getting-started-with-ex">Getting started with Ex</h2>
<ol>
<li><a href="http://www.sencha.com/products/js/thank-you.php?dl=extjs330">Download</a> Ext JS</li>
<li> Unzip it to a folder and you are ready to go!</li>
</ol>
<p>Don&#8217;t be alarmed by the file size, you are downloading the full package including sources and examples  After having Ext in your project folder all that is missing is including its files in your HTML.</p>
<p>You need to include Ext JavaScript and css files:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ext-3.3.0/resources/css/ext-all.css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;ext-3.3.0/adapter/ext/ext-base-debug.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;ext-3.3.0/ext-all-debug.js&quot;&gt;&lt;/script&gt;
</pre>
<p>The above code should be enough to get you started, assuming you unzipped Ext into a folder named ext-3.3.0</p>
<p>An in depth introduction to Ext HTML setup is available <a href="http://www.sencha.com/learn/Tutorial:HTML_Page_Setup">here</a> make sure you also read the <a href="http://www.sencha.com/learn/Tutorial:Ext_StartUp_Guide">Ext getting started guide</a>.</p>
<h2 id="toc-hello-world">Hello World</h2>
<p>Maybe the easiest way to start using Ext in your existing web site is by replacing those nasty JavaScript alert boxes.</p>
<p>In Ext creating a fancy alert box is easy:</p>
<pre class="brush: jscript; title: ; notranslate">
Ext.MessageBox.show({
title: 'Error Alert',
msg: 'Here is an error message!',
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
</pre>
<p>and voila! Now you have a alert box with title, text, and error Icon.</p>
<p><img class="alignnone" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/11/alert.png" alt="" width="230" height="108" /></p>
<p>Unless you are visiting a strange web site you only see alert boxes to display error information.Replacing your alert calls with this code will be a boring task &#8211;  instead you can add this code to the top of your page:</p>
<pre class="brush: jscript; title: ; notranslate">
window.alert = function(str){
Ext.MessageBox.show({
title: 'Error Alert',
msg: str,
buttons: Ext.MessageBox.OK,
icon:Ext.MessageBox.ERROR
});
}
</pre>
<p>You have overwritten the default alert function, all calls to alert() will now show the fancy Ext alert box! The Ext alert box is HTML only, so you might need to replace \n with &lt;br&gt; if your alerts are multi lined</p>
<p>You can do much more with Ext and alert boxes, check it out <a href="http://dev.sencha.com/deploy/dev/examples/message-box/msg-box.html">here</a>.</p>
<h2 id="toc-tooltips">Tooltips</h2>
<p>Tooltips are nice information messages that you can present to your visitors and the good news is that with Ext you can create them easily and automatically. The next example will show you how to automatically add tool tips to all img tags present in the page. For the tool tip text we will use the Alt attribute from the img tag</p>
<pre class="brush: jscript; title: ; notranslate">
Ext.onReady(function(){

Ext.select('img').each(function(el){
var tt = new Ext.ToolTip({
target: el,
title: el.getAttribute('alt')
});
});

});
</pre>
<p>As you can see the code is inside the Ext.onReady function. This ensures the code is executed as soon as the DOM is ready.  If you have code that needs to run on page load, this is the place to have it.</p>
<ol>
<li>The ext.select() function give us an array of all the matching DOM elements, so in our case returns an array with all the images in the page</li>
<li>Each() iterates through an array applying a function to each element</li>
<li>This way we can easily apply a tool tip to all images in the page</li>
<li>For the tool tip text the value of the ALT attribute is used</li>
</ol>
<p>As you might have noticed, with Ext almost all functions can be chained, making it easy and fast to develop</p>
<h2 id="toc-forms">Forms</h2>
<p>Forms are one of the most important components of a web site; be it a contact form, a checkout form, etc. We&#8217;ll now take a look how to create  an Ext form and HTML markup. This way we are providing users with JavaScript enabled browsers an improved user experience but not excluding users unable to process JavaScript.</p>
<p>This is a bit trickier to achieve as we can not create forms directly from HTML markup. In this example we will create an Ext form with some validation but also provide a regular form if Javascript is disabled.</p>
<pre class="brush: xml; title: ; notranslate">

&lt;form id=&quot;myfrm&quot; action=&quot;save-form.php&quot; method=&quot;POST&quot;&gt; &lt;label for=&quot;txtName&quot;&gt;Name&lt;/label&gt;

&lt;input name=&quot;txtName&quot; type=&quot;text&quot; /&gt; &lt;label for=&quot;txtFeedback&quot;&gt;Your comment&lt;/label&gt;
&lt;textarea name=&quot;txtFeedback&quot;&gt;&lt;/textarea&gt;

&lt;input type=&quot;submit&quot; value=&quot;submit&quot; /&gt; &lt;/form&gt;</pre>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[

Ext.onReady(function(){

	var simple = new Ext.FormPanel({
        url:'save-form.php',
        frame:true,
        title: 'Simple Form',
        width: 350,
        defaults: {width: 230},

        items: [
                new Ext.form.TextField({
                	fieldLabel: 'Name',
                	name: 'txtName',
                	allowBlank: false
                }),
                new Ext.form.TextArea({
                	fieldLabel: 'Your comment',
                    name: 'txtFeedBack'
                })
        ],

        buttons: [{
            text: 'submit',
        	handler: function(){
                if(simple.getForm().isValid()){
                	simple.getForm().submit();
                }
            }
        }]
    });

    simple.render('myfrm_ext');
	Ext.get('myfrm').remove();

});

// ]]&gt;&lt;/script&gt;
</pre>
<p>Lets review the code step by step.</p>
<p>In the html portion a basic form we define two elements:</p>
<ol>
<li> The form that will be visible only to users without javascript enabled</li>
<li>An empty div where we will attach our Ext Form</li>
</ol>
<p>In the JavaScript portion we create an Ext form.</p>
<ol>
<li>The first block of options define things like the submission url, the form width and the default values to be applied to form elements</li>
<li>The items option is where the fields are created, one text field and one text area, we also say that the text field must no be empty (allowBlank = false)</li>
<li>In the buttons we add the submit button with an handler function. That function will be called when the button is pressed, and it will submit the form if it passes validation</li>
</ol>
<p><img class="alignnone" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/11/form.png" alt="" width="350" height="198" /></p>
<p>If you are interested about forms take a look at the forms section in the samples, there is so much more you can with them</p>
<h2 id="toc-conclusion">Conclusion</h2>
<p>The goal of this article was to give you an introduction to Ext JS. By now you know all that you need to start adding some nice features to your web site. You can display fancy alert boxes, create eye catching forms, attach custom functions to DOM elements and also how to search and iterate through all of them.</p>
<h3 id="toc-about-the-author">About the Author</h3>
<div class="hotlist">
<p class="author-bio"><img style="background-color: white; border: 1px solid #cecece; padding: 2px; float: left; margin-right: 8px; width: auto;" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/11/nuno-mugshot.jpg" alt="" width="80" height="80" /><strong>Nuno Franco da Costa </strong> is a web developer and sys admin. By day, he works at as team leader in a big web brand, building gaming sites for over 130 million of unique monthly visitors. He loves to code and has a “getting things done” attitude. You can find over at his online presence <a href="http://www.francodacosta.com">www.francodacosta.com</a></p>
</div>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/started-ext-js/">Getting Started with Ext JS</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/' rel='bookmark' title='Client-side text field validation with Javascript'>Client-side text field validation with Javascript</a></li>
<li><a href='http://www.hotscripts.com/blog/cookies-with-javascript/' rel='bookmark' title='Cookies with JavaScript'>Cookies with JavaScript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/started-ext-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beyond Traditional Image Showcase with jQuery</title>
		<link>http://www.hotscripts.com/blog/image-showcase-jquery/</link>
		<comments>http://www.hotscripts.com/blog/image-showcase-jquery/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 11:43:13 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[Around the Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=1766</guid>
		<description><![CDATA[If you run a portfolio or photography website, you're probably tired of traditional vertical, horizontal or grid layout of showcasing images.Addy Osmani, a UK-based Web developer came up with some great ways of showcasing images in a circle, ellipse and stack fashion.<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/image-showcase-jquery/">Beyond Traditional Image Showcase with jQuery</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/google-introduces-webp-image-format/' rel='bookmark' title='Google Introduces WebP – a new image format'>Google Introduces WebP – a new image format</a></li>
<li><a href='http://www.hotscripts.com/blog/jquery-mobile-framework-released/' rel='bookmark' title='jQuery Mobile Framework Released'>jQuery Mobile Framework Released</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-image-effects/' rel='bookmark' title='5 Amazing JavaScript Image Effects Libraries'>5 Amazing JavaScript Image Effects Libraries</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you run a portfolio or photography website, you&#8217;re probably tired of traditional vertical, horizontal or grid layout of showcasing images. From a usability perspective these approaches are perfect but with a personal or entertainment website you can be more unconventional and experiment with different styles. Addy Osmani, a UK-based Web developer came up with some great ways of showcasing images in a circle, ellipse and stack fashion.</p>
<h2 id="toc-jquery-roundrr"><a style="color: #157a43;" href="http://addyosmani.com/blog/jquery-roundrr/">jQuery Roundrr</a></h2>
<p>His new jQuery plugin <a href="http://addyosmani.com/blog/jquery-roundrr/">Roundrr</a> transforms list-based images in an interactive wheel-based gallery with keyboard navigation support. The Flash-like effects are smooth, sleek and functional with image caption and image enlargement support.</p>
<p><a href="http://addyosmani.com/blog/jquery-roundrr/"><img class="aligncenter size-full wp-image-1767" title="roundrr" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/10/roundrr.jpg" alt="" width="480" height="200" /></a><br />
Addy has written several other jQuery based image galleries. Here are some more:</p>
<h2 id="toc-jquery-interactive-photo-stack"><a style="color: #157a43;" href="http://addyosmani.com/blog/jquery-css3-photo-stack/">jQuery Interactive Photo Stack</a></h2>
<p><a href="http://addyosmani.com/blog/jquery-css3-photo-stack/"><img class="aligncenter size-full wp-image-1768" title="jquery-stack" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/10/jquery-stack.jpg" alt="" width="480" height="200" /></a></p>
<h2 id="toc-jquery-shinetime"><a style="color: #157a43;" href="http://addyosmani.com/blog/shinetime/">jQuery ShineTime</a></h2>
<p><a href="http://addyosmani.com/blog/shinetime/"><img class="aligncenter size-full wp-image-1769" title="jquery-shinetime" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/10/jquery-shinetime.jpg" alt="" width="480" height="200" /></a></p>
<h2 id="toc-zoomer-gallery"><a style="color: #157a43;" href="http://addyosmani.com/blog/zoomer-gallery-a-jquery-plugin-for-displaying-images-with-flash-like-zooming-effects/">Zoomer Gallery</a></h2>
<p><a href="http://addyosmani.com/blog/zoomer-gallery-a-jquery-plugin-for-displaying-images-with-flash-like-zooming-effects/"><img class="aligncenter size-full wp-image-1770" title="jquery-zoomer" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/10/jquery-zoomer.jpg" alt="" width="480" height="200" /></a></p>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/image-showcase-jquery/">Beyond Traditional Image Showcase with jQuery</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/google-introduces-webp-image-format/' rel='bookmark' title='Google Introduces WebP – a new image format'>Google Introduces WebP – a new image format</a></li>
<li><a href='http://www.hotscripts.com/blog/jquery-mobile-framework-released/' rel='bookmark' title='jQuery Mobile Framework Released'>jQuery Mobile Framework Released</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-image-effects/' rel='bookmark' title='5 Amazing JavaScript Image Effects Libraries'>5 Amazing JavaScript Image Effects Libraries</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/image-showcase-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15 JavaScript Data Grids to Enhance your HTML Tables</title>
		<link>http://www.hotscripts.com/blog/15-javascript-data-grids-enhance-html-tables/</link>
		<comments>http://www.hotscripts.com/blog/15-javascript-data-grids-enhance-html-tables/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 08:26:49 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[HotLists]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Top 10]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[top10]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=1611</guid>
		<description><![CDATA[DataGrid can help address concerns of HTML tables with large data sets by providing features like sorting, filtering, searching, pagination and even in-line editing for your tables. There are two ways you can add data grid functionality to your tables...<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/15-javascript-data-grids-enhance-html-tables/">15 JavaScript Data Grids to Enhance your HTML Tables</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/html-with-xml-data-binding/' rel='bookmark' title='HTML with XML Data Binding'>HTML with XML Data Binding</a></li>
<li><a href='http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/' rel='bookmark' title='IxEdit – A JavaScript-based interaction design tool'>IxEdit – A JavaScript-based interaction design tool</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-zoom-scripts/' rel='bookmark' title='6 Amazing JavaScript Image Zoom Scripts'>6 Amazing JavaScript Image Zoom Scripts</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Using a plain HTML table for displaying data is a common convention. It works fine as long as you don’t have many records and don’t want your user to manipulate your data. But when building a web application that serves hundreds of records in a table, presentation of data within HTML tables suffers from great usability drawbacks.</p>
<p>A data grid can help address concerns of HTML tables with large data sets by providing features like sorting, filtering, searching, pagination and even in-line editing for your tables. There are two ways you can add data grid functionality to your tables. The first method is to use server-side scripting like <a href="http://www.hotscripts.com/category/php/">PHP</a> or <a href="http://www.hotscripts.com/category/asp-net/">.NET</a> to allow your users to manipulate your table data. The second and recommended method is to use JavaScript to bind grid controls to your tables.</p>
<p>In this post, we’ll take a look at some of the most popular JavaScript Data Grids available on the Net. Some of them are based on <a href="#pure">pure JavaScript</a>, while others are plugins to JavaScript frameworks like <a href="#mootools">Mootools</a>, <a href="#jquery">jQuery</a> and <a href="#prototype">Prototype</a>.</p>
<h1 id="toc-pure-javascript-data-grids">Pure JavaScript Data Grids</h1>
<p><a name="pure"> </a></p>
<h2 id="toc-dhtmlxgrid" style="display: block; clear: left; padding-top: 20px;"><a style="color: #157a43;" href="http://dhtmlx.com/docs/products/dhtmlxGrid/">dhtmlxGrid </a></h2>
<p><a href="http://dhtmlx.com/docs/products/dhtmlxGrid/"><img class="aligncenter size-full wp-image-1638" title="dhtmlxGrid" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/dhtmlxGrid1.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://dhtmlx.com/docs/products/dhtmlxGrid/">dhtmlxGrid</a> is an Ajax-driven JavaScript grid control that supports data in different format including XML, JSON, CSV, HTML table and even custom XML format. The grid component lets you implement nice looking tables with built-in inline editing, filtering, searching and grouping capabilities</p>
<h2 id="toc-editablegrid"><a style="color: #157a43;" href="http://www.webismymind.be/editablegrid/">EditableGrid </a></h2>
<p><a href="http://www.webismymind.be/editablegrid/"><img class="aligncenter size-full wp-image-1627" title="editablegrid" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/editablegrid.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://www.webismymind.be/editablegrid/  ">EditableGrid</a> is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running. It supports sorting of columns based on different datatypes, filtering, inserting and removing rows as well as an automatic Flash chart-rendering feature.</p>
<h2 id="toc-standardista-table-sorting"><a style="color: #157a43;" href="http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting">Standardista Table Sorting</a></h2>
<p><a href="http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting"><img class="aligncenter size-full wp-image-1635" title="standardista" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/standardista.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting">Standardista</a> Table Sorting is a client-side JavaScript sorting module that lets you sort an HTML data table by any column. It is the most basic and easiest to implement table sorting solution we’ve found. It works great with large table sets and supports result of different data types including date, plain text, currency and number.</p>
<h2 id="toc-sortedtable"><a style="color: #157a43;" href="http://friedcellcollective.net/js/SortedTable/examples.html">SortedTable</a></h2>
<p><a href="http://friedcellcollective.net/js/SortedTable/examples.html"><img class="aligncenter size-full wp-image-1634" title="sortedtable" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/sortedtable.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://friedcellcollective.net/js/SortedTable/examples.html">SortedTable</a> is another JavaScript datagrid component that combines table sorting and rows selection and movement. It allows you to select rows and move them up or down your table or even movie them from one table to another. Its sorting feature supports different data types (similar to Standardista).</p>
<h2 id="toc-sigmagrid"><a style="color: #157a43;" href="http://www.sigmawidgets.com/products/sigma_grid2/">SigmaGrid</a></h2>
<p><a href="http://www.sigmawidgets.com/products/sigma_grid2/"><img class="aligncenter size-full wp-image-1639" title="sigmagrid" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/sigmagrid1.jpg" alt="" width="480" height="200" /></a></p>
<p>Written in pure javascript, <a href="http://www.sigmawidgets.com/products/sigma_grid2/">Sigma grid </a>is an open source AJAX data grid for displaying and inline editing data in a scrollable and sortable table. It is very powerful yet easy to use &amp;  integrate with PHP, ASP.NET,  JSP and RoR. One of its great features is the support for printable tabular data.</p>
<h1 id="toc-jquery-data-grid-plugins">jQuery Data Grid Plugins</h1>
<p><a name="jquery"> </a></p>
<h2 id="toc-jtps--datatable-jquery-plugin" style="display: block; clear: left; padding-top: 20px;"><a style="color: #157a43;" href="http://www.overset.com/2008/08/30/animated-sortable-data-table-jquery-plugin--jtps/">jTPS – Datatable jQuery Plugin</a></h2>
<p><a href="http://www.overset.com/2008/08/30/animated-sortable-data-table-jquery-plugin--jtps/"><img class="aligncenter size-full wp-image-1630" title="jtps" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/jtps.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://www.overset.com/2008/08/30/animated-sortable-data-table-jquery-plugin--jtps/">jTPS</a> is a datatable jQuery plugin that offers pagination, animated scrolling through pages and intelligent natural sorting capability. The development version is currently 15KB.</p>
<h2 id="toc-datatables--data-table-jquery-plugin"><a style="color: #157a43;" href="http://www.datatables.net/">DataTables – Data Table jQuery plugin</a></h2>
<p><a href="http://www.datatables.net/"><img class="aligncenter size-full wp-image-1625" title="datatables" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/datatables.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://www.datatables.net/">DataTables</a> is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table. Some of its key features include pagination, on-the-fly filtering and multi-column sorting.</p>
<h2 id="toc-animated-table-sort"><a style="color: #157a43;" href="http://mitya.co.uk/scripts/Table-sort---now-REGEXP-friendly-111#part3">Animated table sort</a></h2>
<p><a href="http://mitya.co.uk/scripts/Table-sort---now-REGEXP-friendly-111#part3"><img class="aligncenter size-full wp-image-1624" title="animated" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/animated.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://mitya.co.uk/scripts/Table-sort---now-REGEXP-friendly-111#part3">This jQuery plugin</a> allows you to animatedly sort a table based on a column&#8217;s &lt;td&gt;s, or on the content/value of a child/descendant element within those &lt;td&gt;s. The various &lt;td&gt;s fly to their new homes, giving a nice effect. It also supports sorting on REGEXP matches. You can also control whether row relationships are maintained, whether it sorts on ascii or numeric and ascending or descending.</p>
<h2 id="toc-flexigrid-for-jquery"><a style="color: #157a43;" href="http://www.flexigrid.info/">Flexigrid for jQuery</a></h2>
<p><a href="http://www.flexigrid.info/"><img class="aligncenter size-full wp-image-1628" title="flexigrid" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/flexigrid.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://www.flexigrid.info/">Flexigrid</a> is a lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect to an xml based data source using Ajax to load the content. It supports resizable and sortable columns, different skinning themes, ability to connect via AJAX, pagination, toolbar and search. One of the great thing about Flexigrid is that you will find a lot of sample codes to integrate it in your preferred scripting language.</p>
<h2 id="toc-tablesorter"><a style="color: #157a43;" href="http://tablesorter.com/docs/">TableSorter </a></h2>
<p><a href="http://tablesorter.com/docs/"><img class="aligncenter size-full wp-image-1637" title="tablesorter" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/tablesorter.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://tablesorter.com/docs/">tablesorter</a> is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.</p>
<h2 id="toc-ingrid"><a style="color: #157a43;" href="http://reconstrukt.com/ingrid/">Ingrid</a></h2>
<p><a href="http://reconstrukt.com/ingrid/"><img class="aligncenter size-full wp-image-1629" title="ingrid" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/ingrid.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://reconstrukt.com/ingrid/">Ingrid</a> is an unobtrusive jQuery component that adds datagrid behaviors (column resizing, paging, sorting, row and column styling, and more) to your tables.</p>
<h1 id="toc-prototype-data-grid-components">Prototype Data Grid Components</h1>
<p><a name="prototype"> </a></p>
<h2 id="toc-tablekit" style="display: block; clear: left; padding-top: 20px;"><a style="color: #157a43;" href="http://millstream.com.au/upload/code/tablekit/index.html">TableKit</a></h2>
<p><a href="http://millstream.com.au/upload/code/tablekit/index.html"><img class="aligncenter size-full wp-image-1636" title="tablekit" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/tablekit.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://millstream.com.au/upload/code/tablekit/index.html ">TableKit</a> is a collection of HTML table enhancements using the Prototype framework. TableKit currently implements row striping, column sorting, column resizing and cell editing using Ajax. It can be implemented by simply calling the JavaScript file and attaching it to a table’s CSS class.</p>
<h2 id="toc-mytablegrid"><a style="color: #157a43;" href="http://pabloaravena.info/mytablegrid/ ">MyTableGrid</a></h2>
<p><a href="http://pabloaravena.info/mytablegrid/"><img class="aligncenter size-full wp-image-1631" title="mytablegrid" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/mytablegrid.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://pabloaravena.info/mytablegrid/ ">MyTableGrid</a> is a JavaScript based DataGrid control built on the Prototype library. It allows you to display your data in a simple and flexible way.  It supports resizable columns, sortable columns and support data import via JSON or AJAX.</p>
<h1 id="toc-mootools-data-grid-components">MooTools Data Grid Components</h1>
<p><a name="mootools"> </a></p>
<h2 id="toc-omnigrid" style="display: block; clear: left; padding-top: 20px;"><a style="color: #157a43;" href="http://www.omnisdata.com/omnigrid/">OmniGrid</a></h2>
<p><a href="http://www.omnisdata.com/omnigrid/"><img class="aligncenter size-full wp-image-1632" title="omnigridtop" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/09/omnigridtop.jpg" alt="" width="480" height="200" /></a></p>
<p><a href="http://www.omnisdata.com/omnigrid/">OmniGrid</a> is a datagrid component that supports table sorting, refresh and pagination. Its ability to connect via AJAX enables it to offer in-line editing, addition and deletion of records as well as rows duplication.</p>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/15-javascript-data-grids-enhance-html-tables/">15 JavaScript Data Grids to Enhance your HTML Tables</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/html-with-xml-data-binding/' rel='bookmark' title='HTML with XML Data Binding'>HTML with XML Data Binding</a></li>
<li><a href='http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/' rel='bookmark' title='IxEdit – A JavaScript-based interaction design tool'>IxEdit – A JavaScript-based interaction design tool</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-zoom-scripts/' rel='bookmark' title='6 Amazing JavaScript Image Zoom Scripts'>6 Amazing JavaScript Image Zoom Scripts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/15-javascript-data-grids-enhance-html-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IxEdit – A JavaScript-based interaction design tool</title>
		<link>http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/</link>
		<comments>http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 12:05:33 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[Around the Web]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=1037</guid>
		<description><![CDATA[IxEdit is the first on-the-fly interaction design tool aimed at allowing designers and developers create interactions with no JavaScript coding and just basic knowledge of HTML and CSS.<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/">IxEdit – A JavaScript-based interaction design tool</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/raphael-javascript-vector-library/' rel='bookmark' title='Meet Raphaël, the JavaScript Vector Library'>Meet Raphaël, the JavaScript Vector Library</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-image-cropping-scripts/' rel='bookmark' title='8 Most Popular JavaScript Image Cropping Scripts'>8 Most Popular JavaScript Image Cropping Scripts</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-zoom-scripts/' rel='bookmark' title='6 Amazing JavaScript Image Zoom Scripts'>6 Amazing JavaScript Image Zoom Scripts</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>jQuery is the de facto solution for creating highly interactive interface elements for web applications. From date pickers, drag and drop and other DOM elements animations and effects, jQuery supports them all either natively or through its plugins. However, jQuery can be intimating for those not well versed with JavaScript especially when it comes to writing bunch of codes to create various interactions for multiple page elements.</p>
<div id="attachment_1038" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-1038 " title="changeclass" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/03/changeclass-300x212.png" alt="" width="300" height="212" /><p class="wp-caption-text">IxEdit Design Tool</p></div>
<p>Enter <a href="http://ixedit.com/">IxEdit</a>, the first on-the-fly interaction design tool aimed at allowing designers and developers create interactions with no JavaScript coding and just basic knowledge of HTML and CSS. After writing your HTML and CSS, simply embed IxEdit into your source and it will display an elegant floating tool with different options and attributes. You can then create new interactions by selecting the DOM element right from your page and setting up the interaction attributes like drag and drop, fade, etc. You can then preview your changes in real time. For example with a few mouse clicks, you can create a tab-based navigation for your form or add a date picker to your textbox. Once you&#8217;re happy with the interaction created, you can export the JavaScript generated and copy and paste it to your source.</p>
<p>IxEdit works under Firefox, Safari, Chrome and Internet Explorer to make your browser your interaction development environment.</p>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/">IxEdit – A JavaScript-based interaction design tool</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/raphael-javascript-vector-library/' rel='bookmark' title='Meet Raphaël, the JavaScript Vector Library'>Meet Raphaël, the JavaScript Vector Library</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-image-cropping-scripts/' rel='bookmark' title='8 Most Popular JavaScript Image Cropping Scripts'>8 Most Popular JavaScript Image Cropping Scripts</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-zoom-scripts/' rel='bookmark' title='6 Amazing JavaScript Image Zoom Scripts'>6 Amazing JavaScript Image Zoom Scripts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/ixedit-javascript-based-interaction-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 AJAX &amp; JavaScript Calendar Scripts</title>
		<link>http://www.hotscripts.com/blog/7-ajax-javascript-calendar-scripts/</link>
		<comments>http://www.hotscripts.com/blog/7-ajax-javascript-calendar-scripts/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 13:49:58 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[HotLists]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=925</guid>
		<description><![CDATA[The ease of use, rich and intuitive scheduling solution offered by Google Calendar has inspired many to create CSS and AJAX calendars with similar interface and features. In this post, we take a look at some of these AJAX calendars &#038; JavaScript calendars along with full-fledged calendar scripts similar to Google Calendar, Microsoft Outlook's Calendar or Apple's iCal.<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/7-ajax-javascript-calendar-scripts/">7 AJAX &#038; JavaScript Calendar Scripts</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/javascript-image-cropping-scripts/' rel='bookmark' title='8 Most Popular JavaScript Image Cropping Scripts'>8 Most Popular JavaScript Image Cropping Scripts</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-zoom-scripts/' rel='bookmark' title='6 Amazing JavaScript Image Zoom Scripts'>6 Amazing JavaScript Image Zoom Scripts</a></li>
<li><a href='http://www.hotscripts.com/blog/oop-javascript/' rel='bookmark' title='OOP in JavaScript'>OOP in JavaScript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The ease of use, rich and intuitive scheduling solution offered by <a href="http://www.google.com/calendar">Google Calendar</a> has inspired many to create CSS and AJAX calendars with similar interface and features. In this post, we take a look at some of these AJAX calendars &amp; JavaScript calendars along with full-fledged calendar scripts similar to Google Calendar, Microsoft Outlook&#8217;s Calendar or Apple&#8217;s iCal.</p>
<div class="blog_title">
<h1 id="toc-ajax-and-css-calendar-interfaces">AJAX and CSS Calendar Interfaces</h1>
</div>
<p>The scripts below are great starting point to build your calendar. They only provide front-end scheduling interface based on AJAX and CSS. You will have to write your own code that will hook to the different events and possibly an admin area to store and manage the events.</p>
<h2 id="toc-fullcalendar">FullCalendar</h2>
<p><a href="http://arshaw.com/fullcalendar/"><img class="alignnone size-full wp-image-932" title="fullcalendar3" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/fullcalendar3.jpg" alt="fullcalendar3" width="550" height="150" /></a></p>
<p><a href="http://arshaw.com/fullcalendar/ ">FullCalendar</a> is a jQuery plugin that provides a full-sized, drag &amp; drop calendar like the one below. It uses AJAX to fetch events on-the-fly for each month and is easily configured to use your own feed format (an extension is provided for Google Calendar). It is visually customizable and exposes hooks for user-triggered events (like clicking or dragging an event).</p>
<h2 id="toc-dhtmlxscheduler">dhtmlxScheduler</h2>
<p><img class="alignnone size-full wp-image-933" title="dhtmlxScheduler2" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/dhtmlxScheduler2.jpg" alt="dhtmlxScheduler2" width="550" height="150" /></p>
<p><a href="http://dhtmlx.com/docs/products/dhtmlxScheduler/index.shtml">dhtmlxScheduler</a> is a Web-based JavaScript events calendar that provides rich and intuitive scheduling solution similar to Microsoft Outlook Calendar, Apple&#8217;s iCal or Google Calendar. The events can be displayed in Day, Week, Month or Year views. Advanced drag-n-drop functionality allows users to change events dates and time by easily moving or resizing event boxes. Very lightweight (about 20Kb gzipped), fast-performing, and it uses Ajax to smoothly update and display events schedule.  dhtmlxScheduler is also available as plugins for WordPress, Joomla and Drupal.</p>
<h2 id="toc-jmonthcalendar">jMonthCalendar</h2>
<p><a href="http://www.bytecyclist.com/projects/jmonthcalendar/"><img class="alignnone size-full wp-image-934" title="jmonthcalendar" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/jmonthcalendar.jpg" alt="jmonthcalendar" width="550" height="150" /></a></p>
<p><a href="http://www.bytecyclist.com/projects/jmonthcalendar/">jMonthCalendar</a> is a full month calendar that supports events. You simply initialize the calendar with options and an events array and it can handle the rest. This calendar is based on jQuery and has extension points that allow the developer to interact with the calendar when the display is about to change months, after the display has changed months and when the event bubbles are clicked on. jMonthCalendar also supports hover extension points, hover over an event and trigger an event like an alert(); By default the events would each have a URL supplied that would link to a details page.</p>
<h2 id="toc-moogenda">MooGenda</h2>
<p><a href="http://www.moonkiki.com/moonkiki/moogenda/"><img class="alignnone size-full wp-image-941" title="moogenda" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/moogenda.jpg" alt="moogenda" width="550" height="150" /></a></p>
<p><a href="http://www.moonkiki.com/moonkiki/moogenda/"> MooGenda</a> is a javascript calendar based on MooTools, that reads events from JSON requests. MooGenda supports double click on event to see the deafult event view, drag and drop event in month view, every change send a request to back end, to store when and what changed in the event.</p>
<div class="blog_title">
<h1 id="toc-calendars-with-database-or-flat-files-support">Calendars with database or flat-files support</h1>
</div>
<p>If you&#8217;re looking to save time building an admin interface for any of the above solutions reviewed, then the following full-fledged calendar systems are perhaps what you need. They come with both the front-end and back-end.</p>
<h2 id="toc-luxcal">LuxCal</h2>
<p><a href="http://www.hotscripts.com/listing/luxcal-web-based-event-calendar/"><img class="alignnone size-full wp-image-935" title="luxcal" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/luxcal.jpg" alt="luxcal" width="550" height="150" /></a></p>
<p><a href=" http://www.hotscripts.com/listing/luxcal-web-based-event-calendar/"> LuxCal</a> is a relative new calendar solution and compared to the other calendar solutions outlined above, LuxCal does not only come with a front-end interface but a complete event management system based on PHP and MySQL. It has been designed for user-friendliness, with support for views like month, day, year and upcoming events. LuxCal has support for colored event categories, recurring events, email notifications of event due dates, private events, access rights configurable for each user and for public access, CSV file import (for instance Outlook export), multi-language support and customizable user interface colors.</p>
<h2 id="toc-monket-calendar">Monket Calendar</h2>
<p><a href="http://monket.net/wiki-v2/Monket_Calendar"><img class="alignnone size-full wp-image-936" title="monketcalendar" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/monketcalendar.jpg" alt="monketcalendar" width="550" height="150" /></a></p>
<p><a href="http://monket.net/wiki-v2/Monket_Calendar">Monket Calendar</a> is coded in HTML, CSS, Javascript, and PHP. It is based on the premise of providing an Apple iCal style interface that is available wherever you are. The interface has been designed to make it as easy as possible to add/change/remove events and thereby reduce the frustration of using the browser for entering and managing data. Monket Calendar is one of the few calendar scripts that can display multi-day events spanning accross the days on which they occur. This spanning of events makes it much easier to read the calendar at a glance.</p>
<h2 id="toc-planscalendar">PlansCalendar</h2>
<p><a href="http://www.planscalendar.com/"><img class="alignnone size-full wp-image-937" title="PlansCalendar" src="http://www.hotscripts.com/blog/wp-content/uploads/2010/01/PlansCalendar.jpg" alt="PlansCalendar" width="550" height="150" /></a></p>
<p><a href="http://www.planscalendar.com">PlansCalendar</a> is a highly configurable, customizable and easy-to-install calendar script. It is written in Perl. Events can be stored in either flat files or SQL databases. It has support for multiple-calendars, each of which can be managed separately all the while sharing events between each other. PlansCalendar also comes with an add-ons system whereby you can write plugins that re-use ist framework.</p>
<div class="blog_title">
<h1 id="toc-other-calendar-solutions">Other calendar solutions</h1>
</div>
<p>There are of course several other calendar scripts that you can choose from. In this post, we have only highlighted calendar scripts with an interface close to Google Calendar. For more calendars including date pickers, event planners scripts, please visit our <a href="http://www.hotscripts.com/search/all/calendar">directory</a>.</p>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/7-ajax-javascript-calendar-scripts/">7 AJAX &#038; JavaScript Calendar Scripts</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/javascript-image-cropping-scripts/' rel='bookmark' title='8 Most Popular JavaScript Image Cropping Scripts'>8 Most Popular JavaScript Image Cropping Scripts</a></li>
<li><a href='http://www.hotscripts.com/blog/javascript-zoom-scripts/' rel='bookmark' title='6 Amazing JavaScript Image Zoom Scripts'>6 Amazing JavaScript Image Zoom Scripts</a></li>
<li><a href='http://www.hotscripts.com/blog/oop-javascript/' rel='bookmark' title='OOP in JavaScript'>OOP in JavaScript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/7-ajax-javascript-calendar-scripts/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Create simple cross-browser textarea editor</title>
		<link>http://www.hotscripts.com/blog/create-textarea-editor/</link>
		<comments>http://www.hotscripts.com/blog/create-textarea-editor/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 03:01:26 +0000</pubDate>
		<dc:creator>DEVpapers</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=643</guid>
		<description><![CDATA[This tutorial will help you create simple richtext editor you can use on any of your HTML forms.<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/create-textarea-editor/">Create simple cross-browser textarea editor</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/ckeditor-javascript-wysiwyg-editor/' rel='bookmark' title='CKEditor &#8211; A JavaScript WYSIWYG Editor'>CKEditor &#8211; A JavaScript WYSIWYG Editor</a></li>
<li><a href='http://www.hotscripts.com/blog/php-error-log-file-archive/' rel='bookmark' title='Create Own PHP Error Log File Archive'>Create Own PHP Error Log File Archive</a></li>
<li><a href='http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/' rel='bookmark' title='Client-side text field validation with Javascript'>Client-side text field validation with Javascript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div><span></p>
<div>
<p><strong>This tutorial will help you create simple richtext editor you can use on any of your HTML forms.</strong> <a href="http://bewebmaster.com/editorjs/">View the sample</a>.<br />
The main DHTML methods we will use are:</p>
<ul>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/execcommand.asp" target="_blank">execCommand.</a><br />
This method  executes a command on the current document, current selection, or the given range.</li>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/getelementbyid.asp" target="_blank">getElementById</a><br />
Returns a reference to the first object with the specified value of the <a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/id.asp" target="_blank">ID</a> attribute.</li>
</ul>
<p>Commands specify an action to take on the given object. Commands we will use are:</p>
<ul>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/bold.asp" target="_blank">Bold<br />
</a>Toggles the current selection between bold and nonbold.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/underline.asp" target="_blank">Underline</a><br />
Toggles the current selection between underlined and not underlined.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/italic.asp" target="_blank">Italic</a><br />
Toggles the current selection between italic and nonitalic.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/justifycenter.asp" target="_blank">JustifyCenter</a><br />
Centers the format block in which the current selection is located.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/justifyleft.asp" target="_blank">JustifyLeft</a><br />
Left-justifies the format block in which the current selection is located.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/justifyright.asp" target="_blank">JustifyRight</a><br />
Right-justifies the format block in which the current selection is located.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/indent.asp" target="_blank">Indent</a><br />
Increases the indent of the selected text by one indentation increment.</li>
<li><a href="http://msdn.microsoft.com/workshop/author/dhtml/reference/constants/outdent.asp" target="_blank">Outdent</a><br />
Decreases by one increment the indentation of the format block in which the current selection is located.</li>
<li>Undo<br />
Undo the step</li>
<li>Redo<br />
Redo the step</li>
</ul>
<p>Main DHTML properties we will use are:</p>
<ul>
<li><a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/innerhtml.asp" target="_blank">innerHTML<br />
</a>Sets or retrieves the HTML between the start and end tags of the <span>object.</span></li>
<li><span><a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/designmode.asp" target="_blank">designMode<br />
</a>Sets or retrieves a value that indicates whether the document can be edited.</span></li>
</ul>
<p>First, we will create the form.htm page containing the buttons and a javascript code that will call the functions which display and update editors textarea. I will not take too much time explaining the html code except that the form is using form.php file to display content submitted.<br />
Download the button images <a href="http://bewebmaster.com/editorjs/images.zip">here</a>.</p>
<table id="12" border="1" cellspacing="0" cellpadding="10" width="99%" bgcolor="#ffffff" bordercolor="#000000">
<tbody>
<tr>
<td><span style="color: #000099;">&lt;html&gt;<br />
&lt;head&gt;</span><br />
<span style="color: #000099;">&lt;title&gt;</span>Rich Text Editor<span style="color: #000099;">&lt;/title&gt;</span></p>
<p><span style="color: #000099;">&lt;/head&gt;<br />
&lt;body&gt;</span><br />
<span style="color: #cc0000;">&lt;script language</span>= <span style="color: #3333ff;">&#8220;JavaScript&#8221;</span> <span style="color: #cc0000;">type</span>= <span style="color: #3333ff;">&#8220;text/javascript&#8221; </span><span style="color: #cc0000;">src</span>= <span style="color: #3333ff;">&#8220;editor.js&#8221;</span> <span style="color: #cc0000;">&gt;&lt;/script&gt;</span><br />
<span style="color: #006600;">&lt;table width=&#8221;750&#8243;&gt;</span><br />
<span style="color: #ff6600;">&lt;form action=&#8221;form.php&#8221; name=&#8221;edit&#8221; method=&#8221;POST&#8221; id=&#8221;edit&#8221; onsubmit=&#8221;return submitForm();&#8221;&gt;</span><br />
<span style="color: #006600;">&lt;tr&gt;<br />
&lt;td&gt; </span>&lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;bold&#8217;, &#8221;)&#8221; </span>&gt;&lt;img src=&#8221;images/bold.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Bold&#8221; title=&#8221;Bold&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt;</span> &lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;underline&#8217;, &#8221;)&#8221; </span>&gt;&lt;img  src=&#8221;images/underline.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Underline&#8221; title=&#8221;Underline&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt; </span>&lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;italic&#8217;, &#8221;)&#8221;</span> &gt;&lt;img  src=&#8221;images/italic.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Italic&#8221; title=&#8221;Italic&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt;</span> &lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;justifyleft&#8217;, &#8221;)&#8221;</span> &gt;&lt;img  src=&#8221;images/j_left.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Align Left&#8221; title=&#8221;Align Left&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt; </span>&lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;justifycenter&#8217;, &#8221;)&#8221; </span>&gt;&lt;img src=&#8221;images/j_center.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Align Center&#8221; title=&#8221;Align Center&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt; </span>&lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;justifyright&#8217;, &#8221;)&#8221;</span> &gt;&lt;img src=&#8221;images/j_right.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Align Right&#8221; title=&#8221;Align Right&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt;</span> &lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;indent&#8217;, &#8221;)&#8221; </span>&gt;&lt;img src=&#8221;images/indent.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Indent&#8221; title=&#8221;Indent&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt;</span> &lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;outdent&#8217;, &#8221;)&#8221;</span> &gt;&lt;img src=&#8221;images/outdent.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Outdent&#8221; title=&#8221;Outdent&#8221;&gt;&lt;/a&gt;<span style="color: #006600;"> &lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt;</span> &lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;undo&#8217;, &#8221;)&#8221; </span>&gt;&lt;img src=&#8221;images/undo.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Undo&#8221; title=&#8221;Undo&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td&gt;</span> &lt;a href= <span style="color: #3333ff;">&#8220;javascript:editorCommand(&#8216;content&#8217;, &#8216;redo&#8217;, &#8221;)&#8221; </span>&gt;&lt;img src=&#8221;images/redo.gif&#8221; width=&#8221;25&#8243; height=&#8221;24&#8243; alt=&#8221;Redo&#8221; title=&#8221;Redo&#8221;&gt;&lt;/a&gt; <span style="color: #006600;">&lt;/td&gt;</span></p>
<p><span style="color: #006600;">&lt;td width=&#8221;100%&#8221; align=&#8221;levt&#8221;&gt;</span>Shift+Enter for single line spacing<span style="color: #006600;">&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td colspan=&#8221;12&#8243;&gt;</span><br />
<span style="color: #cc0000;">&lt;script language</span>= <span style="color: #3333ff;">&#8220;JavaScript&#8221; </span><span style="color: #cc0000;">type=</span> <span style="color: #3333ff;">&#8220;text/javascript&#8221;</span> <span style="color: #cc0000;">&gt;</span><br />
<em><span style="color: #666666;">&lt;!&#8211;</span></em><br />
<strong>function</strong> submitForm() <strong>{<br />
</strong> updateEditor(&#8216;content&#8217;);<br />
<strong><span style="color: #000099;">return true</span></strong>;<br />
<strong>}</strong></p>
<p>initiateEditor();<br />
<em><span style="color: #666666;">//&#8211;&gt;</span><br />
</em><span style="color: #cc0000;">&lt;/script&gt;<br />
</span><span style="color: #cc0000;">&lt;script language</span>= <span style="color: #3333ff;">&#8220;JavaScript&#8221; </span><span style="color: #cc0000;">type</span>= <span style="color: #3333ff;">&#8220;text/javascript&#8221; </span><span style="color: #cc0000;">&gt;</span><br />
<span style="color: #666666;"> //this calles displayEditor function. Parametars are (textarea name, textarea  width, textarea  height)<br />
</span> displayEditor(<span style="color: #ff0000;">&#8216;content&#8217;</span>,<span style="color: #cc0000;"> &#8216; &#8216;</span>, <span style="color: #ff0000;">600</span>, <span style="color: #ff0000;">300</span>);<br />
<span style="color: #666666;">//&#8211;&gt;</span><br />
<span style="color: #cc0000;">&lt;/script&gt;</span><br />
<span style="color: #006600;">&lt;/td&gt;<br />
&lt;/tr&gt;</span><br />
<span style="color: #006600;">&lt;tr&gt;&lt;td colspan=&#8221;12&#8243;&gt; </span><span style="color: #ff6600;">&lt;input type=&#8221;submit&#8221; name=&#8221;Submit&#8221; value=&#8221;Submit&#8221;&gt; </span><span style="color: #006600;">&lt;/td&gt;&lt;/tr&gt;</span><br />
<span style="color: #ff6600;">&lt;/form&gt;</span><br />
<span style="color: #006600;">&lt;/table&gt;</span></p>
<p><span style="color: #000099;">&lt;/body&gt;<br />
&lt;/html&gt;</span></td>
</tr>
</tbody>
</table>
<p>So let&#8217;s create the javascript file that does all the work called editor.js.</p>
<table id="85" border="1" cellspacing="0" cellpadding="10" width="99%" bgcolor="#ffffff" bordercolor="#000000">
<tbody>
<tr>
<td><em><span style="color: #666666;">//First lets initiate some variables</span></em></p>
<p><span style="color: #000099;"><strong>var </strong></span>isEditable= <span style="color: #000099;"><strong>false</strong></span>;<br />
<span style="color: #000099;"><strong>var </strong></span>isIE;<br />
<span style="color: #000099;"><strong>var</strong></span> isGecko;<br />
<span style="color: #000099;"><strong>var </strong></span>isSafari;<br />
<span style="color: #000099;"><strong>var</strong></span> isKonqueror;</p>
<p><strong>function</strong> initiateEditor() <strong>{</strong><br />
<em> <span style="color: #666666;">//check what browser is in use</span><br />
</em><span style="color: #000099;"><strong> var</strong> </span>browser = <span style="color: #ff0000;">navigator</span>.userAgent.toLowerCase();<br />
isIE = ((browser .<span style="color: #009900;">indexOf</span>( <span style="color: #3366ff;">&#8220;msie&#8221;</span> ) != -1) &amp;&amp; (browser .<span style="color: #009900;">indexOf</span>(<span style="color: #3366ff;"> &#8220;opera&#8221; </span>) == -1) &amp;&amp; (browser .<span style="color: #009900;">indexOf</span>( <span style="color: #3366ff;">&#8220;webtv&#8221; </span>) == -1));<br />
isGecko = (browser .<span style="color: #009900;">indexOf</span>( <span style="color: #3366ff;">&#8220;gecko&#8221;</span> ) != -1);<br />
isSafari = (browser .<span style="color: #009900;">indexOf</span>( <span style="color: #3366ff;">&#8220;safari&#8221; </span>) != -1);<br />
isKonqueror = (browser.<span style="color: #009900;">indexOf</span>( <span style="color: #3366ff;">&#8220;konqueror&#8221;</span> ) != -1);<br />
<em><br />
<span style="color: #666666;"> //enable designMode if the browser is not safari or konqueror.</span><br />
</em> if (<span style="color: #ff0000;">document</span>.getElementById &amp;&amp; <span style="color: #ff0000;">document</span>.designMode &amp;&amp; !isSafari &amp;&amp; !isKonqueror) <strong>{<br />
</strong> isEditable= <strong><span style="color: #000099;">true</span></strong>;<br />
<strong> }<br />
}<br />
</strong><em><span style="color: #666666;">//Javascript function dislpayEditor will create the textarea. </span></em></p>
<p><strong>function </strong>displayEditor(editor, html, width, height) <strong>{<br />
</strong> if(isEditable)<strong>{</strong><br />
<span style="color: #ff0000;"> document</span>.<span style="color: #009900;">writeln</span>(<span style="color: #3366ff;">&#8216;&lt;iframe id=&#8221;&#8216; </span>+ editor +<span style="color: #3366ff;"> &#8216;&#8221; name=&#8221;&#8216;</span> + editor + <span style="color: #3366ff;">&#8216;&#8221; width=&#8221;&#8216; </span>+ width + <span style="color: #3366ff;">&#8216;px&#8221; height=&#8221;&#8216; </span>+ height +<span style="color: #3366ff;"> &#8216;px&#8221;&gt;&lt;/iframe&gt;&#8217;</span>);<br />
<em><span style="color: #666666;">//create a hidden field that will hold everything that is typed in the textarea</span><br />
</em> <span style="color: #ff0000;">document.</span><span style="color: #009900;">writeln</span>(<span style="color: #3366ff;">&#8216;&lt;input type=&#8221;hidden&#8221; id=&#8221;hidden&#8217; </span>+ editor + <span style="color: #3366ff;">&#8216;&#8221; name=&#8221;&#8216; </span>+ editor + <span style="color: #3366ff;">&#8216;&#8221; value=&#8221;"&gt;&#8217;</span>);<br />
<em><span style="color: #666666;">//assign html (textarea value) to hiddeneditor </span><br />
</em> <span style="color: #ff0000;">document</span>.getElementById(<span style="color: #3366ff;">&#8216;hidden&#8217; </span>+ editor).value = html;<br />
<em><span style="color: #666666;">//call function designer</span><br />
</em> designer(editor, html);<br />
<strong> }</strong>else<strong>{<br />
</strong> <span style="color: #ff0000;">document.</span><span style="color: #009900;">writeln</span>(<span style="color: #3366ff;">&#8216;&lt;textarea name=&#8221;&#8216; </span>+ editor + <span style="color: #3366ff;">&#8216;&#8221; id=&#8221;&#8216;</span> + editor + <span style="color: #3366ff;">&#8216;&#8221; cols=&#8221;39&#8243; rows=&#8221;10&#8243;&gt;&#8217; </span>+ html + <span style="color: #3366ff;">&#8216;&lt;/textarea&gt;&#8217;</span>);<br />
<strong> }<br />
}</strong></p>
<p><em><span style="color: #666666;">//this is designer function that enables designMode and writes defalut text to the text area</span><br />
</em><strong>function </strong>designer(editor, html) <strong>{<br />
</strong> <span style="color: #000099;"><strong> var </strong></span>mainContent= <span style="color: #4169e1;">&#8216;</span><span style="color: #3366ff;">&lt;html id=&#8221;&#8216; </span>+ editor + <span style="color: #4169e1;">&#8216;</span><span style="color: #3366ff;">&#8220;&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&#8221;&#8216; </span>+ html + <span style="color: #4169e1;">&#8216;</span><span style="color: #3366ff;">&#8220;&lt;/body&gt;&lt;/html&gt;&#8217;</span><span style="color: #000000;"> ;<br />
</span><em><span style="color: #666666;">//assign the frame(textarea) to the edit variable using that frames id</span><br />
</em> <strong><span style="color: #000099;">var </span></strong>edit = <span style="color: #ff0000;">document.</span>getElementById(editor).contentWindow.<span style="color: #ff0000;">document</span>;<br />
<em><span style="color: #999999;"><span style="color: #666666;">//write the content to the textarea</span><br />
</span></em> edit.<span style="color: #009900;">write</span>(mainContent);<br />
<em><span style="color: #999999;">//enable the designMode</span><br />
</em> edit.designMode =  <span style="color: #3366ff;">&#8220;On&#8221;</span> ;<br />
<em><span style="color: #999999;">//enable the designMode for Mozilla</span></em><br />
<span style="color: #ff0000;"> document.</span>getElementById(content).contentDocument.designMode = <span style="color: #3333ff;"><span style="color: #3366ff;">&#8220;on&#8221;</span> </span>;<br />
<em><strong>}</strong></em></p>
<p><span style="color: #666666;"><em>//To execute command we will use javascript function execCommand.</em> </span><br />
<strong>function </strong>editorCommand(editor, command, option) <strong>{<br />
<em><span style="color: #666666;">// </span></em></strong><em><span style="color: #666666;">first we assign the content of the textarea to the variable mainField</span></em><br />
<span style="color: #3333ff;"> <strong><span style="color: #000099;">var</span></strong> </span>mainField;<br />
mainField = <span style="color: #ff0000;">document</span>.getElementById(editor).contentWindow;<br />
<span style="color: #666666;"><em> // then we will use execCommand to execute the option on the textarea making sure the textarea stays in focus</em></span><br />
try<strong> {<br />
</strong> mainField.<span style="color: #ff0000;">focus</span>();<br />
mainField.<span style="color: #ff0000;">document</span>.execCommand(command, <span style="color: #000099;"><strong>false</strong></span>, option);<br />
mainField.<span style="color: #ff0000;">focus</span>();<br />
<strong>}</strong> catch (e) <strong>{ }<br />
}</strong></p>
<p><strong>function</strong> updateEditor(editor)<strong> {<br />
<span style="color: #00008b;"> if</span></strong> (!isEditable) <strong><span style="color: #000080;">return</span></strong>;<br />
<span style="color: #a9a9a9;"><span style="color: #696969;"><em>//assign the value of the textarea to the hidden field.</em></span><br />
</span><strong><span style="color: #191970;"> var</span></strong> hiddenField = <span style="color: #ff0000;">document</span>.getElementById(<span style="color: #0000ff;">&#8216;hidden&#8217;</span> + editor);<br />
<strong><span style="color: #000080;"> if</span></strong> (hiddenField.value == null) hiddenField.value = &#8220;&#8221;;<br />
hiddenField.value = <span style="color: #ff0000;">document</span>.getElementById(editor).contentWindow.<span style="color: #ff0000;">document</span>.<span style="color: #0000ff;">body.innerHTML</span>;<br />
<strong>}</strong></td>
</tr>
</tbody>
</table>
<p>Now that we have the JavaScript code let&#8217;s create form.php file. Most important part of the form.php is the phpSafe function. This function makes sure that quotes are displayed appropriatly.</p>
<table id="37" border="1" cellspacing="0" cellpadding="10" width="99%" bgcolor="#ffffff" bordercolor="#000000">
<tbody>
<tr>
<td><span style="color: #ff0000;"><strong>&lt;?php<br />
</strong></span><span style="color: #ff9900;">// from the form we are getting the hidden field value and sending it to the phpSafe function<br />
</span>$hiddencontent = phpSafe($hiddencontent);<br />
<strong>function</strong> phpSafe($strText) {<br />
<span style="color: #ff9900;">//removes backslash created by php from the string</span><br />
$tmpString = $strText;<br />
$tmpString = <span style="color: #000099;">str_replace</span>(<span style="color: #000099;">chr</span>(<span style="color: #ff0000;">92</span>), <span style="color: #ff0000;">&#8220;&#8221;</span>, $tmpString);<br />
<span style="color: #000099;">return</span> $tmpString;<br />
}<br />
<span style="color: #000099;">echo</span> $hiddencontent;<br />
<span style="color: #ff0000;"><strong>?&gt;</strong></span></td>
</tr>
</tbody>
</table>
<p>Save all three files in the same folder and upload to your server. Play with the code and try adding more functionality or buttons. Here are some helpfull resources:</p>
<ul>
<li><a href="http://msdn.microsoft.com/library/default.asp">MSDN library</a></li>
<li><a href="http://www.mozilla.org/editor/">Mozilla Editor</a></li>
<li><a href="http://bewebmaster.com/">BeWebmaster.com</a></li>
</ul>
</div>
<p></span></div>
<div class="hotlist"><strong>Author:  Emir Plicanic</strong> of <a href="http://www.bewebmaster.com/">bewebmaster.com</a></div>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/create-textarea-editor/">Create simple cross-browser textarea editor</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/ckeditor-javascript-wysiwyg-editor/' rel='bookmark' title='CKEditor &#8211; A JavaScript WYSIWYG Editor'>CKEditor &#8211; A JavaScript WYSIWYG Editor</a></li>
<li><a href='http://www.hotscripts.com/blog/php-error-log-file-archive/' rel='bookmark' title='Create Own PHP Error Log File Archive'>Create Own PHP Error Log File Archive</a></li>
<li><a href='http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/' rel='bookmark' title='Client-side text field validation with Javascript'>Client-side text field validation with Javascript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/create-textarea-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Not to Script HTML Form Validation</title>
		<link>http://www.hotscripts.com/blog/how-not-to-script-html-form-validation/</link>
		<comments>http://www.hotscripts.com/blog/how-not-to-script-html-form-validation/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 03:01:23 +0000</pubDate>
		<dc:creator>Ahmad Permessur</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=683</guid>
		<description><![CDATA[Avoid some common errors when using Javascript to perform client-side HTML form validation<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/how-not-to-script-html-form-validation/">How Not to Script HTML Form Validation</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/' rel='bookmark' title='Client-side text field validation with Javascript'>Client-side text field validation with Javascript</a></li>
<li><a href='http://www.hotscripts.com/blog/understanding-script-licenses/' rel='bookmark' title='Understanding Script Licenses'>Understanding Script Licenses</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0in; font-family: verdana,arial,helvetica,sans-serif;" align="left"><span style=""><a href="http://crockford.com/">Douglas Crockford</a> has dubbed Javascript “the world&#8217;s most misunderstood programming language.” If he is correct, and I believe he is, then it should be no surprise that a good deal of Javascript development is tainted by “AntiPatterns”.<br />
</span></p>
<p style="margin-bottom: 0in; font-family: verdana,arial,helvetica,sans-serif;" align="left"><span style="">An AntiPattern quite simply is <a href="http://antipatterns.com/thebook.htm">what does not work</a>. Let&#8217;s consider what this means on a couple of different levels, within the context of validating form data with Javascript.<br />
</span></p>
<p style="margin-bottom: 0in; font-family: verdana,arial,helvetica,sans-serif;" align="left"><span style="">First lets consider specific code that “does not work”. Recent books have gotten better at avoiding the following sort of thing, but it remains widespread to this day (to keep this example as brief as possible I&#8217;m not including any code that would provide feedback to the user, such as a Javascript alert).<br />
</span></p>
<table border="0" align="left">
<tbody>
<tr>
<td bgcolor="#dcdcdc"><span style="font-family: Courier New,monospace; color: #ff4500;"><span style="">&lt;form<br />
onsubmit= &#8216;return this.fname.value != &#8220;&#8221; &amp;amp;&amp;amp; this.lname.value !=&#8221;"&#8216;&gt;<br />
First Name: &lt;input type=&#8221;text&#8221; name=&#8221;fname&#8221;&gt;<br />
&lt;br&gt;<br />
Last Name: &lt;input type=&#8221;password&#8221; name=&#8221;lname&#8221;&gt;<br />
&lt;br&gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;Log In&#8221;&gt;<br />
&lt;/form&gt; </span></span></td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0in;" align="left">
<p style="margin-bottom: 0in;" align="left"><span style=""><br />
</span></p>
<p style="margin-bottom: 0in;" align="left"><span style=""><br />
</span></p>
<p style="margin-bottom: 0in;" align="left"><span style=""><br />
If the user enters absolutely nothing into either fname or lname, the form&#8217;s onsubmit handler will return false and the form will not be submitted. The code successfully prevents submitting completely empty fields.</span></p>
<p style="margin-bottom: 0in; font-family: verdana,arial,helvetica,sans-serif;" align="left"><span style="">It does not however prevent the user from entering spaces into those fields. It is therefore not enough to test against the empty string “”.<br />
</span></p>
<p style="margin-bottom: 0in; font-family: verdana,arial,helvetica,sans-serif;" align="left"><span style="">The solution is to test against a “regular expression” object. For the uninitiated, “regex”&#8217;s, as they are also sometimes called, represent a pattern of characters. For the task at hand, we are going to use a very simple pattern: </span><span style="font-family: Courier New,monospace; color: #ff4500;"><span style="">/\S/ </span></span></p>
<p><span style="">The first thing to notice are the beginning and ending slashes. These simply signify that what&#8217;s between them is the expression, not unlike quotation marks signifying that they contain text.</p>
<p>Within the slashes, the pattern </span><span style="font-family: Courier New,monospace; color: #ff4500;"><span style="">\S </span></span><span style="">stands for any non-whitespace character. Regular expressions in Javascript have some useful built in methods, including </span><span style="font-family: Courier New,monospace; color: #ff4500;"><span style="">test()</span></span> <span style="">, which returns true or false depending on whether a string passed as an argument matches the pattern.</p>
<p>So in the above example we can just switch the onsubmit event handler to the following, and it will not only reject completely empty fields, but also fields containing only whitespace, such as spaces:<br />
</span></p>
<table border="0" align="left">
<tbody>
<tr>
<td bgcolor="#dcdcdc"><span style="font-family: Courier New,monospace; color: #ff4500;"><span style="">onsubmit=&#8217;return /\S/.test(this.fname.value) &amp;amp;&amp;amp; /\S/.test(this.lname.value)&#8217; </span></span></td>
</tr>
</tbody>
</table>
<p><span style=""> Substituting the above, now both name fields must contain some non-whitespace characters in order for the form to get submitted.</span><span style=""> Following the colorful parlance for AntiPatterns, the erroneous example on page 1 might be called the <em>“Out of Sight Out of Mind”</em> AntiPattern.  Except that AntiPatterns typically describe a problem that is more systemic, rather than one that can be so readily rectified by correcting one line of code.  For instance, failure &#8212; or refusal &#8212; to use a  language feature such as Regular Expressions.</p>
<p>Better yet exemplifying a bona fide AntiPattern in a Javascript form validation context is what I call the <em>“All Web Development is New Development”</em> fallacy.  This antiPattern, like the code defect debunked in the first example, is commonplace both in books and in code libraries distributed all over the web.</p>
<p><em>“All Web Development is New Development”</em> in the Javascript form validation context most often occurs through the suggestion that, to signify that form fields are required to be filled in, these required fields must be named in a certain manner.  Users of such code are instructed to do such things as end the names of their form fields with </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“_req”</span></span> <span style="">.</p>
<p>So, in our first example, </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“fname”</span></span> <span style=""> would become </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“fname_req”</span></span> <span style=""> , and </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“lname”</span></span> <span style=""> would become </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“lname_req”</span></span> <span style="">.   To begin with, though, this violates one of <a href="http://cpptips.hyperformix.com/cpptips/heuristics2"> Arthur J Riel&#8217;s Object-Oriented Design Heuristics</a>, particularly 3.5, which states in part: “In applications which consist of an object-oriented model interacting with a user interface, the model should never be dependent on the interface.”<br />
</span></p>
<p style="margin-bottom: 0in; font-family: verdana,arial,helvetica,sans-serif;" align="left"><span style="">The HTML comprises the user interface.  Now substitute “data” for “model” above.  Data is required to specify one field as required, and another as not required.  But by appending </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“_req”</span></span> <span style=""> to the name of an HTML form element, the data becomes dependent on the interface.</p>
<p></span></p>
<p><span style="">Rules are made to be broken, but not in this instance.  Because, although requiring that form field names have “_req” be appended to them might work in the case of a new web application, what about an existing web application?  It almost certainly consists in part of server-side form processing code that relies on pre-determined form field names.  Adding </span> <span style="font-family: Courier New,monospace; color: #ff4500;"> <span style="">“_req”</span></span> <span style=""> to those field names will almost certainly cause existing server-side code to malfunction.</span></p>
<div class="hotlist"><strong>About the Author: George Jempty</strong><br />Born on Long Island in 1963. Learned to program in Junior High using the orange book &#8220;Basic Basic&#8221;. Two careers prior to IT were Food Service and Market Research. First exposure to enterprise development came as &#8220;Fielding&#8221; (Data Collection) Director for a successful market research start-up in the early 90&#8242;s. IT professional since 1998. Have contracted for or been employed by several nationally and internationally recognized corporations. Specialities include database and web development.</div>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/how-not-to-script-html-form-validation/">How Not to Script HTML Form Validation</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/' rel='bookmark' title='Client-side text field validation with Javascript'>Client-side text field validation with Javascript</a></li>
<li><a href='http://www.hotscripts.com/blog/understanding-script-licenses/' rel='bookmark' title='Understanding Script Licenses'>Understanding Script Licenses</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/how-not-to-script-html-form-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client-side text field validation with Javascript</title>
		<link>http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/</link>
		<comments>http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 03:01:21 +0000</pubDate>
		<dc:creator>DEVpapers</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.hotscripts.com/blog/?p=699</guid>
		<description><![CDATA[Javascript is as powerful as any client-side language comes, and text field validation is a tremendously desired capability many webmasters want for their forms. Let's take a look at a little javascript for the purpose of validating feedback forms.<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/">Client-side text field validation with Javascript</a></p>

Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/cookies-with-javascript/' rel='bookmark' title='Cookies with JavaScript'>Cookies with JavaScript</a></li>
<li><a href='http://www.hotscripts.com/blog/differences-java-javascript/' rel='bookmark' title='Differences between Java and JavaScript'>Differences between Java and JavaScript</a></li>
<li><a href='http://www.hotscripts.com/blog/oop-javascript/' rel='bookmark' title='OOP in JavaScript'>OOP in JavaScript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Verdana; ">I will admit that I am not a huge fan of client-side scripting (for the exception of HTML, of course) because of its relatively low power and compatibility between browsers. Javascript, however, is as powerful as any client-side language comes, and text field validation is a tremendously desired capability many webmasters want for their forms, and without server-side languages (or at least knowledge of them), Javascript is relied upon very heavily.</span></p>
<p><span style="font-family: Verdana; "><strong>Calling the appropriate form</strong></span></p>
<p><span style="font-family: Verdana; ">Javascript allows for a couple different calls to document forms, either by the name or by the position of the form within the document relative to other forms, beginning at 0. For example, if an HTML document contains 2 forms, the first form would be called as follows:</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">document.forms[0]</span></p>
<p><span style="font-family: Verdana; ">For those familiar with arrays, this will come fairly clearly to you. Javascript will build the number of forms into an array, called forms. Arrays always begin at 0, so to figure out the actual array value of the form, take the forms position on the page, relative to other forms, and subtract one. The 5th form, for example, would be called like this:</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">document.forms[4]</span></p>
<p><span style="font-family: Verdana; ">If you provide your HTML forms names, the name of the form can also be used and will be easier for many webmasters. Simply replace the position of forms[x] with the form name. For example, if a form&#8217;s name was &#8216;feedback&#8217;, calling that specific form within the document would be written like this:</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">document.feedback</span></p>
<p><span style="font-family: Verdana; "><strong>Amazing Javascript error checking</strong></span></p>
<p><span style="font-family: Verdana; ">Each form element belongs, or lives, within one single form, so when error checking multiple forms on one single page, no discrepancies will surface. When checking a particular form field, we call it by the name and check its value. So, let&#8217;s say we have the following form item in our first document form:</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;input type=&#8221;text&#8221; Name=&#8221;FirstName&#8221;&gt;</span></p>
<p><span style="font-family: Verdana; ">We don&#8217;t have to define a value within the HTML coding because we rely on your web site viewer to do that. To make sure that when the form is submitted, the form item is checked before processing, we&#8217;ll use javascript&#8217;s onSubmit function within the form tag, like so:</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;form action=&#8221;test.php&#8221; method=&#8221;post&#8221; onSubmit=&#8221;return checkme()&#8221;&gt;</span></p>
<p><span style="font-family: Verdana; ">All tags rest in the &lt;head&gt; and &lt;/head&gt; portion of our HTML document. In addition, a Javascript function is used and named whatever you like, to error check the text box, which may be a new concept to many fairly light Javascript programmers. A function is simply a set, or chunk, of code used with or without variables to perform a particular function. Here&#8217;s what I&#8217;ve used to check the text box named FirstName. The elements in green signify Javascript comments and will not be displayed when the page is loaded.</span></p>
<table border="0" cellspacing="2" cellpadding="2" width="100%" bgcolor="#dcdcdc">
<tbody>
<tr>
<td><span style="font-family: Courier New; color: #ff4500; ">&lt;SCRIPT LANGUAGE=&#8221;javascript&#8221;&gt; </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;!&#8211; // Hide the following code from non-Javascript enabled browsers </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">// The following sets the cursor automatically in the FirstName text box field </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">function focus() // Define function focus </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">{<br />
// Sets cursor to FirstName input element<br />
document.forms[0].FirstName.focus();<br />
} </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">function checkme() // Define function checkme<br />
{<br />
if (document.forms[0].FirstName.value == &#8220;&#8221;)<br />
{<br />
alert(&#8220;You did not enter your first name. Please provide it.&#8221;);<br />
document.forms[0].FirstName.focus();return(false)<br />
}<br />
}<br />
//&#8211;&gt; </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;/SCRIPT&gt; // End the Javascript script</span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Verdana; ">Beyond the focus() function, we first use an if statement to check whether the input element FirstName is blank. If it is, an error will be displayed in the form of a popup window and the form will not be processed. You can simply copy and paste for any form element in your form, changing the field name, of course. </span></p>
<p><span style="font-family: Verdana; "><strong>Putting it all together</strong></span></p>
<p><span style="font-family: Verdana; ">Alright, I&#8217;ve broken the code down into sections, so let&#8217;s bring this code together into one HTML document. Here&#8217;s what a simple form would look like with three text boxes.</p>
<p></span></p>
<table border="0" cellspacing="2" cellpadding="2" width="100%" bgcolor="#dcdcdc">
<tbody>
<tr>
<td><span style="font-family: Courier New; color: #ff4500; ">&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;SCRIPT LANGUAGE=&#8221;javascript&#8221;&gt; </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;!&#8211; </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">function focus()<br />
{<br />
document.forms[0].FirstName.focus();<br />
}</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">function checkme() //check for required fields<br />
{<br />
if (document.forms[0].FirstName.value == &#8220;&#8221;)<br />
{alert(&#8220;You did not enter your first name. Please provide it.&#8221;);<br />
document.forms[0].FirstName.focus();return(false)<br />
} </span></p>
<p><span style="font-family: Courier New; color: #ff4500; "> if (document.forms[0].MiddleName.value == &#8220;&#8221;)<br />
{alert(&#8220;You did not enter your middle name. Please provide it.&#8221;);<br />
document.forms[0].MiddleName.focus();return(false)<br />
} </span></p>
<p><span style="font-family: Courier New; color: #ff4500; "> if (document.forms[0].LastName.value == &#8220;&#8221;)<br />
{alert(&#8220;You did not enter your last name. Please provide it.&#8221;);<br />
document.forms[0].LastName.focus();return(false)<br />
} </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">}<br />
//&#8211;&gt;</span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;/SCRIPT&gt;<br />
&lt;/head&gt;<br />
&lt;body onLoad=&#8221;focus()&#8221;&gt; </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;form action=test.php method=post onSubmit=&#8221;return checkme()&#8221; name=Feedback&gt;<br />
First name: &lt;input type=&#8221;text&#8221; name=&#8221;FirstName&#8221;&gt;&lt;br&gt;<br />
Middle name: &lt;input type=&#8221;text&#8221; name=&#8221;MiddleName&#8221;&gt;&lt;br&gt;<br />
Last name: &lt;input type=&#8221;text&#8221; name=&#8221;LastName&#8221;&gt;&lt;br&gt;<br />
&lt;input type=&#8221;Submit&#8221;&gt;<br />
&lt;/form&gt; </span></p>
<p><span style="font-family: Courier New; color: #ff4500; ">&lt;/body&gt;<br />
&lt;/html&gt;</span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: Verdana; ">Enjoy.</span></p>
<div class="hotlist"><strong>About the Author: Steve Adcock</strong><br />Steve Adcock is a web developer and a recent college graduate and systems analyst. Steve has 9 years of web development experience and has skllis in HTML, CSS, PHP and MySQL, along with a good working knowledge of Adobe Photoshop and a keen understanding of web design techniques. Steve also runs www.websitegravy.com, a completely free, not for profit technology writing center aimed at taking the ambiguity out of computers and web design.</div>
<p>Post from: <a href="http://www.hotscripts.com/blog">Hot Scripts Blog</a><br/><br/><a href="http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/">Client-side text field validation with Javascript</a></p>
<p>Related posts:<ol>
<li><a href='http://www.hotscripts.com/blog/cookies-with-javascript/' rel='bookmark' title='Cookies with JavaScript'>Cookies with JavaScript</a></li>
<li><a href='http://www.hotscripts.com/blog/differences-java-javascript/' rel='bookmark' title='Differences between Java and JavaScript'>Differences between Java and JavaScript</a></li>
<li><a href='http://www.hotscripts.com/blog/oop-javascript/' rel='bookmark' title='OOP in JavaScript'>OOP in JavaScript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hotscripts.com/blog/client-side-text-field-validation-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

