<?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>Monie Studios &#187; form</title>
	<atom:link href="http://www.moniestudios.com/tag/form/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.moniestudios.com</link>
	<description>So much to learn, so little time!</description>
	<lastBuildDate>Sat, 21 Aug 2010 04:59:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Introduction &#8211; jQuery Tip Series: Form</title>
		<link>http://www.moniestudios.com/tutorials/jquery-tip-series-form/</link>
		<comments>http://www.moniestudios.com/tutorials/jquery-tip-series-form/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 00:44:24 +0000</pubDate>
		<dc:creator>Monie</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.moniestudios.com/?p=414</guid>
		<description><![CDATA[Introducing... Monieweb.com jQuery Tips Series, a series of tips and tutorial mainly about jQuery, nothing but jQuery! All tips and tutorial is based on my own experience during the learning process.]]></description>
			<content:encoded><![CDATA[<p>On this first series, I&#8217;ll be talking about <strong>jQuery Tip Series: Form</strong>. Enjoy yourself.</p>
<h2>The Scenario!</h2>
<p>Have you ever fill an online form that require you to fill in the same information twice? In other words, does your patience being tested every time you fill an online form? The following demonstration will show you how you can play around with your form value in this example, joining two separate field value and assigned them into another third field value.</p>
<p>The following example is just a basic tutorial. With this knowledge, you can manipulate them and use them in developing your very own user friendly web form.</p>
<h2>Demo: jQuery</h2>
<div class="sticky" style="padding: 10px 15px;">
<input id="fname" name="fname" value="William">
<input id="surname" name="surname" value="Shakespeare">
<input id="fullname" name="fullname" value="">
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/jquery.min.js"></script><br />
<script type="text/javascript">function FillIn() { $('#fullname').val($('#fname').val() + ' ' + $('#surname').val()); } $(document).ready(function () { $('#fname').bind('blur', function () { FillIn(); }); $('#surname').bind('blur', function () { FillIn(); }); FillIn(); }); </script>
</div>
<h2>JavaScript Approach</h2>
<pre class="brush: php;">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Input Joining&lt;/title&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
    function FillIn() {
        document.getElementById('fullname').value =
        document.getElementById('fname').value + ' ' + document.getElementById('surname').value;
    }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body onLoad=&quot;FillIn()&quot;&gt;
    &lt;input id=&quot;fname&quot; name=&quot;fname&quot; value=&quot;William&quot; onblur=&quot;FillIn()&quot;&gt;
    &lt;input id=&quot;surname&quot; name=&quot;surname&quot; value=&quot;Shakespeare&quot; onblur=&quot;FillIn()&quot;&gt;
    &lt;input id=&quot;fullname&quot; name=&quot;fullname&quot; value=&quot;&quot;&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>jQuery Approach</h2>
<pre class="brush: vb;">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Input Joining&lt;/title&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        function FillIn() {
            $('#fullname').val($('#fname').val() + ' ' + $('#surname').val());
        }
        $(document).ready(function () {
            $('#fname').bind('blur', function () { FillIn(); });
            $('#surname').bind('blur', function () { FillIn(); });
            FillIn();
        });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;input id=&quot;fname&quot; name=&quot;fname&quot; value=&quot;William&quot;&gt;
    &lt;input id=&quot;surname&quot; name=&quot;surname&quot; value=&quot;Shakespeare&quot;&gt;
    &lt;input id=&quot;fullname&quot; name=&quot;fullname&quot; value=&quot;&quot;&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>So, which one is better?</h2>
<p>Some say jQuery is a short form for complex JavaScript code&#8230;</p>
<blockquote><p>&#8230;using straight-up javascript is almost always going to be more efficient than using a framework (i.e. jQuery). jQuery should really only be used to make complex javascript coding tasks simpler to write, and more accessible for those who don&#8217;t know advanced javascript. The other benefit would be cross-browser compatibility.</p>
<p><strong>japh, Thewebsqueeze.</strong>
</p></blockquote>
<p>and some say jQuery perform better than JavaScript&#8230;</p>
<blockquote><p>&#8230;the difference in speed is hardly a significant issue. In real performance terms, code execution is not going to be much different. Note also that jQuery has benefited from staggering performance improvements in version 1.3.</p>
<p>..it&#8217;s actually more efficient to use jQuery&#8217;s syntax (in most cases), as it&#8217;s much more terse.</p>
<p><strong>MikeHopley, Thewebsqueeze.</strong>
</p></blockquote>
<p>Full discussion on: <a class="mw" href="http://www.thewebsqueeze.com/forum/Javascript-f66/Javascript-To-Jquery-Conversion-t4882.html">Thewebsqueeze.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moniestudios.com/tutorials/jquery-tip-series-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
