<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PHP for Bangladesh</title>
	<atom:link href="http://php4bd.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://php4bd.wordpress.com</link>
	<description>PHP fan? Let's share our codes, feelings and everything.</description>
	<lastBuildDate>Wed, 14 Nov 2007 04:31:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='php4bd.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>PHP for Bangladesh</title>
		<link>http://php4bd.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://php4bd.wordpress.com/osd.xml" title="PHP for Bangladesh" />
	<atom:link rel='hub' href='http://php4bd.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Hellow World! I&#8217;ve moved&#8230;</title>
		<link>http://php4bd.wordpress.com/2007/10/07/hellow-world-ive-moved/</link>
		<comments>http://php4bd.wordpress.com/2007/10/07/hellow-world-ive-moved/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 08:14:02 +0000</pubDate>
		<dc:creator>anisniit</dc:creator>
				<category><![CDATA[personal]]></category>
		<category><![CDATA[ajaXray]]></category>
		<category><![CDATA[move]]></category>

		<guid isPermaLink="false">http://php4bd.wordpress.com/2007/10/07/hellow-world-ive-moved/</guid>
		<description><![CDATA[Hellow World! Now I am here&#8230;. at ajaXray. I have been blogging on wordpress for a short time as http://php4bd.wordpress.com/. Though it&#8217;s a nice experience, I am facing some limitations there. Moreover, I have been thinking for a domain to share, test and explore my works and experience on an unique web identity. As a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=php4bd.wordpress.com&amp;blog=1177412&amp;post=11&amp;subd=php4bd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hellow World! Now I am here&#8230;. at <a href="http://www.ajaxray.com" title="ajaXray" target="_blank"><strong>ajaXray</strong></a>.</p>
<p>I have been blogging on <a href="http://wordpress.com/" title="wordpress" target="_blank">wordpress</a> for a short time as <a href="http://php4bd.wordpress.com/" title="My old blog" target="_blank">http://php4bd.wordpress.com/</a>. Though it&#8217;s a nice experience, I am facing some limitations there. Moreover, I have been thinking for a domain to share, test and explore my works and experience on an unique web identity. As a  result, I get the domain ajaXray.</p>
<p><strong>Behind  the name :  </strong>The name &#8220;ajaXray&#8221; comes from 2 words.</p>
<ol>
<li><strong><u>ajax:</u> </strong><strong>AJAX</strong>, is a <a href="http://en.wikipedia.org/wiki/Web_development" title="Web development">web development</a> technique used for creating interactive <a href="http://en.wikipedia.org/wiki/Web_application" title="Web application">web applications</a>. This is the current crazes of web technologies.</li>
<li><u><strong>X-ray</strong></u>: <strong>X-rays</strong> (or <strong>Röntgen rays</strong>) are a form of electromagnetic radiation with a wavelength in the range of 10 to 0.01 nanometers. generally, its known to us for it&#8217;s power of scanning. I choose the word after ajax to express the interest of exploring the web technologies in such a scanning depth.</li>
</ol>
<p>And the last thing&#8230; this domain+hosting is gifted by my (30%)boss, (30%)teacher and (40%) friend <strong><a href="http://www.phpfour.com/blog/" title="phpfour" target="_blank">Emran Hasan aka phpfour</a>.</strong>today is his birthday. HAPPY BIRTHDAY TO PHPFOUR.<a href="http://www.phpfour.com/blog/" title="phpfour" target="_blank"><strong><br />
</strong></a></p>
<p><a href="http://www.phpfour.com/blog/" title="phpfour" target="_blank"></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/php4bd.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/php4bd.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/php4bd.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/php4bd.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/php4bd.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/php4bd.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/php4bd.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/php4bd.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/php4bd.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/php4bd.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=php4bd.wordpress.com&amp;blog=1177412&amp;post=11&amp;subd=php4bd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://php4bd.wordpress.com/2007/10/07/hellow-world-ive-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1529c12e371e2e39c92230d292bdd77d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anisniit</media:title>
		</media:content>
	</item>
		<item>
		<title>Ajax-like Unobtrusive File Upload</title>
		<link>http://php4bd.wordpress.com/2007/07/28/ajax-like-unobtrusive-file-upload/</link>
		<comments>http://php4bd.wordpress.com/2007/07/28/ajax-like-unobtrusive-file-upload/#comments</comments>
		<pubDate>Sat, 28 Jul 2007 20:29:37 +0000</pubDate>
		<dc:creator>anisniit</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://php4bd.wordpress.com/2007/07/28/ajax-like-unobstrusive-file-upload/</guid>
		<description><![CDATA[We use AJAX whenever we need to communicate with the server, without reloading the page. But this doesn’t function in the case of File Upload. In usual view, uploading files with AJAX is impossible! (FireFox/Mozilla can do this after change a setting in &#8220;about:config&#8221; – which we cannot guarantee for a lot of users). When [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=php4bd.wordpress.com&amp;blog=1177412&amp;post=7&amp;subd=php4bd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We use AJAX whenever we need to communicate with the server, without reloading the page. But this doesn’t function in the case of File Upload. In usual view, uploading files with AJAX is impossible! (FireFox/Mozilla can do this after change a setting in &#8220;about:config&#8221; – which we cannot guarantee for a lot of users).</p>
<p>When I was searching for any technique to upload file without reloading page, I found a script in <a href="http://www.webtoolkit.info" target="_blank">www.webtoolkit.info</a> . But it seemed very complex to me. Then I try to simplify their technique and its working great. So I thought why not share the technique with everybody?</p>
<p>First, look at the demo <a href="http://anis.rightbrainsolution.com/examples/NoAjaxUpload/" target="_blank">here</a> to see how it works.</p>
<p>OK. Let’s get into the deep. What happens when we submit a form? The form is submitted to the action page and that page loaded in current frame of window. If the “target” attribute of form indicate “_blank” or any frame name of the window, the page loads in a blank window or in the named frame or inner frame. Here we’ll be using the second method.</p>
<p>First, take an inner frame in anywhere of the page.  And set the display property of this frame as “none”:</p>
<p><font face="Courier New"><font size="2"><font color="#000000"><font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000FF">&lt;</font><font color="#800000">iframe</font><font color="#000000">&nbsp;</font><font color="#FF0000">name</font><font color="#000000">=</font><font color="#0000FF">&quot;hiddenFrame&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">id</font><font color="#000000">=</font><font color="#0000FF">&quot;hiddenFrame&quot;</font><font color="#000000">&nbsp;</font><br />
<font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF0000">src</font><font color="#000000">=</font><font color="#0000FF">&quot;about:blank&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">style</font><font color="#000000">=</font><font color="#0000FF">&quot;display:none&quot;</font><font color="#000000">&nbsp;</font><font color="#0000FF">&gt;</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000FF">&lt;/</font><font color="#800000">iframe</font><font color="#0000FF">&gt;</font><font color="#000000">&nbsp;</font><br />
<font color="#008080">    </font></font></p>
<p>Now, just set this frame as the target of your uploading form.</p>
<p><font color="#008080"></font><font color="#0000FF">&lt;</font><font color="#800000">form</font><font color="#000000">&nbsp;</font><font color="#FF0000">name</font><font color="#000000">=</font><font color="#0000FF">&quot;testForm&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">id</font><font color="#000000">=</font><font color="#0000FF">&quot;testForm&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">enctype</font><font color="#000000">=</font><font color="#0000FF">&quot;multipart/form-data&quot;</font><font color="#000000">&nbsp;</font><br />
<font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF0000">action</font><font color="#000000">=</font><font color="#0000FF">&quot;upload.php&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">method</font><font color="#000000">=</font><font color="#0000FF">&quot;post&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">target</font><font color="#000000">=</font><font color="#0000FF">&quot;hiddenFrame&quot;</font><font color="#0000FF">&gt;</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000FF">&lt;</font><font color="#800000">input</font><font color="#000000">&nbsp;</font><font color="#FF0000">type</font><font color="#000000">=</font><font color="#0000FF">&quot;file&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">name</font><font color="#000000">=</font><font color="#0000FF">&quot;name&quot;</font><font color="#000000">&nbsp;/</font><font color="#0000FF">&gt;</font><font color="#000000">&nbsp;</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000FF">&lt;</font><font color="#800000">input</font><font color="#000000">&nbsp;</font><font color="#FF0000">type</font><font color="#000000">=</font><font color="#0000FF">&quot;submit&quot;</font><font color="#000000">&nbsp;</font><font color="#FF0000">value</font><font color="#000000">=</font><font color="#0000FF">&quot;Upload!&quot;</font><font color="#000000">&nbsp;/</font><font color="#0000FF">&gt;</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000FF">&lt;/</font><font color="#800000">form</font><font color="#0000FF">&gt;</font></font></font></font></p>
<p>If we submit this form now, it will submit the file to the target script on the server (can be in php, asp etc.). The script will upload the file and will load the response in the frame “hiddenFrame”. As the frame is not visible, nothing about this loading will be seen by the visitors. Now, as the uploading page displays nothing after uploading your file, the response can be immediate. Although it’s not AJAX, this technique will upload your file without (visually) reloading page.</p>
<p><u><strong> What more?</strong></u></p>
<p>For many purpose, we might need a callback function when using AJAX. For this file uploading technique also, we will try to create something like that. First, we’ll write the callback function as a simple JavaScript function in the header of the uploading page:</p>
<p><font face="Courier New"><font size="2"><font color="#000000"><font color="#808080">&lt;</font><font color="#808080">script</font><font color="#808080">&nbsp;</font><font color="#808080">language</font><font color="#808080">=</font><font color="#808080">&quot;javascript&quot;</font><font color="#808080">&gt;</font><br />
<b><font color="#000080">function</font></b><font color="#008080">&nbsp;</font><font color="#000000">trackThis</font><font color="#580000">()</font><br />
<font color="#580000">{</font><br />
<b><font color="#000080">var</font></b><font color="#008080">&nbsp;</font><font color="#000000">resultDiv</font><font color="#008080">&nbsp;</font><font color="#580000">=</font><font color="#008080">&nbsp;</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">window</font><font color="#580000">.</font><font color="#000000">frames</font><font color="#580000">.</font><font color="#000000">hiddenFrame</font><font color="#580000">.</font><font color="#000000">document</font><font color="#580000">.</font><font color="#000000">getElementById</font><font color="#580000">(</font><font color="#008000">&#8216;result&#8217;</font><font color="#580000">);</font><br />
<b><font color="#000080">var</font></b><font color="#008080">&nbsp;</font><font color="#000000">uploadedImage</font><font color="#008080">&nbsp;</font><font color="#580000">=</font><font color="#008080">&nbsp;</font><font color="#000000">document</font><font color="#580000">.</font><font color="#000000">getElementById</font><font color="#580000">(</font><font color="#008000">&#8216;UploadedImage&#8217;</font><font color="#580000">);<br />
</font><br />
<font color="#000000">uploadedImage</font><font color="#580000">.</font><font color="#000000">src</font><font color="#008080">&nbsp;</font><font color="#580000">=</font><font color="#008080">&nbsp;</font><font color="#000000">resultDiv</font><font color="#580000">.</font><font color="#000000">innerHTML</font><font color="#580000">;</font><font color="#008080">&nbsp;</font><br />
<font color="#000000">uploadedImage</font><font color="#580000">.</font><font color="#000000">style</font><font color="#580000">.</font><font color="#000000">display</font><font color="#580000">=</font><font color="#008000">&quot;block&quot;</font><font color="#580000">;<br />
</font><br />
<font color="#000000">alert</font><font color="#580000">(</font><font color="#008000">&quot;File&nbsp;Uploaded&nbsp;:&quot;</font><font color="#008080">&nbsp;</font><font color="#580000">+</font><font color="#008080">&nbsp;</font><font color="#000000">resultDiv</font><font color="#580000">.</font><font color="#000000">innerHTML</font><font color="#580000">);</font><br />
<font color="#580000">}</font><br />
<font color="#808080">&lt;/</font><font color="#808080">script</font><font color="#808080">&gt;</font></font></font></font></p>
<p>When the uploading of the server page is complete, it should print the JavaScript code in the hidden iframe, to call the callback function with the reference “window.top”. Any other required information also can be printed in specific DIVs. It will enable us to retrieve any response information using the innerHTML of any specific DIV (as shown in example callback function).</p>
<p>Example:</p>
<p><font face="Courier New"><font size="2"><font color="#000000"><b><i><font color="#FF0000">&lt;?php</font></i></b><br />
<font color="#0000FF">print_r</font><font color="#000000">(</font><font color="#005800">$_FILES</font><font color="#000000">[</font><font color="#800000">&quot;name&quot;</font><font color="#000000">]);</font><br />
<b><font color="#000080">if</font></b><font color="#000000">(</font><font color="#0000FF">move_uploaded_file</font><font color="#000000">(</font><font color="#005800">$_FILES</font><font color="#000000">[</font><font color="#800000">&quot;name&quot;</font><font color="#000000">][</font><font color="#800000">&quot;tmp_name&quot;</font><font color="#000000">],</font><font color="#008080">&nbsp;</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000FF">dirname</font><font color="#000000">(</font><b><font color="#000080">__FILE__</font></b><font color="#000000">).</font><font color="#800000">&quot;/&quot;</font><font color="#000000">.</font><font color="#005800">$_FILES</font><font color="#000000">[</font><font color="#800000">'name'</font><font color="#000000">][</font><font color="#800000">'name'</font><font color="#000000">]))</font><br />
<font color="#000000">{</font><br />
<b><font color="#000080">echo</font></b><font color="#008080">&nbsp;</font><font color="#800000">&quot;Your&nbsp;uploaded&nbsp;file&nbsp;is:&nbsp;&lt;div&nbsp;id=&#8217;result&#8217;&gt;&quot;</font><font color="#000000">.</font><font color="#005800">$_FILES</font><font color="#000000">[</font><font color="#800000">'name'</font><font color="#000000">][</font><font color="#800000">'name'</font><font color="#000000">].</font><font color="#800000">&quot;&nbsp;&lt;/div&gt;&quot;</font><font color="#000000">;</font><br />
<font color="#000000">}</font><font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<b><font color="#000080">else</font></b><br />
<font color="#000000">{</font><br />
<font color="#008080">&nbsp;&nbsp;&nbsp;&nbsp;</font><b><font color="#000080">echo</font></b><font color="#008080">&nbsp;</font><font color="#800000">&quot;&lt;div&nbsp;id=&#8217;result&#8217;&gt;Sorry!&nbsp;Error&nbsp;occured!&lt;/div&gt;&quot;</font><font color="#000000">;</font><font color="#008080">&nbsp;&nbsp;</font><br />
<font color="#000000">}</font><br />
<b><font color="#000080">echo</font></b><font color="#008080">&nbsp;</font><font color="#000000">&lt;&lt;&lt;test</font><br />
<font color="#008000">&lt;script&nbsp;type=&quot;text/javascript&quot;&gt;</font><br />
<font color="#008000">window.top.trackThis()</font><br />
<font color="#008000">&lt;/script&gt;</font><br />
<font color="#000000">test;</font><br />
<b><i><font color="#FF0000">?&gt;<br />
</font></i></b></font></font></font></p>
<p>Well, that&#8217;s it. This technique has already saved my ass once, see if it can save yours also when you need.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/php4bd.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/php4bd.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/php4bd.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/php4bd.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/php4bd.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/php4bd.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/php4bd.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/php4bd.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/php4bd.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/php4bd.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=php4bd.wordpress.com&amp;blog=1177412&amp;post=7&amp;subd=php4bd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://php4bd.wordpress.com/2007/07/28/ajax-like-unobtrusive-file-upload/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1529c12e371e2e39c92230d292bdd77d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anisniit</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery controlled Dependent (or Cascading) Select List</title>
		<link>http://php4bd.wordpress.com/2007/07/15/javascript-controlled-dependent-or-cascading-select-list/</link>
		<comments>http://php4bd.wordpress.com/2007/07/15/javascript-controlled-dependent-or-cascading-select-list/#comments</comments>
		<pubDate>Sun, 15 Jul 2007 19:52:25 +0000</pubDate>
		<dc:creator>anisniit</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://php4bd.wordpress.com/2007/07/15/javascript-controlled-dependent-or-cascading-select-list/</guid>
		<description><![CDATA[When I was searching the web for a client side dependent list boxes, I got some scripts. But some of them were very much static (static select name, option name etc.), some were vary complex. Then I thought to make it myself. I have been using jQuery as the standard JavaScript library for most of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=php4bd.wordpress.com&amp;blog=1177412&amp;post=3&amp;subd=php4bd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I was searching the web for a client side dependent list boxes, I got some scripts. But some of them were very much static (static select name, option name etc.), some were vary complex. Then I thought to make it myself.<br />
I have been using jQuery as the standard JavaScript library for most of my web project for some days. Writing javascript coding in jQuery is fun. So here goes my contribution using it.</p>
<p>Here is a simple <a href="http://www.piggymate.com/anis/flakes/depend2.html" target="_blank">demo</a>.</p>
<p>Let me guide you through it.</p>
<p>1. Include jqury.js.</p>
<p style="background-color:#eeeeee;">    &lt;script language=&#8221;javascript&#8221; src=&#8221;jquery.js&#8221;&gt;&lt;/script&gt;</p>
<p>You can get Jquery from <a href="http://jquery.com" target="_blank">here</a>.</p>
<p>2. Write this simple function in a javascript block in head.</p>
<p style="background-color:#eeeeee;"> function makeSublist(parent,child,isSubselectOptional)<br />
{<br />
$(&#8220;body&#8221;).append(&#8220;&lt;select style=&#8217;display:none&#8217; id=&#8217;&#8221;+parent+child+&#8221;&#8216;&gt;&lt;/select&gt;&#8221;);<br />
$(&#8216;#&#8217;+parent+child).html($(&#8220;#&#8221;+child+&#8221; option&#8221;));<br />
$(&#8216;#&#8217;+child).html(&#8220;&lt;option&gt; &#8212; &lt;/option&gt;&#8221;);<br />
$(&#8216;#&#8217;+parent).change(<br />
function()<br />
{<br />
var parentValue = $(&#8216;#&#8217;+parent).attr(&#8216;value&#8217;);<br />
$(&#8216;#&#8217;+child).html($(&#8220;#&#8221;+parent+child+&#8221; .sub_&#8221;+parentValue).clone());<br />
if(isSubselectOptional) $(&#8216;#&#8217;+child).prepend(&#8220;&lt;option&gt; &#8212; Select &#8212; &lt;/option&gt;&#8221;);<br />
}<br />
);<br />
}</p>
<p>This function takes 3 arguments: the parent select input&#8217;s id, the child select input&#8217;s id, and a boolean value to indicate whether to select an item from child list by default.</p>
<p>Example:  <strong>makeSublist(&#8216;listA&#8217;,'listB&#8217;,false);</strong></p>
<p>This function will make the options of &#8216;listB&#8217; list depending on the selection of &#8216;listA&#8217;. And user have to select an item from &#8216;listB&#8217;.<br />
Here &#8216;listA&#8217; and &#8216;listB&#8217; are the IDs of parent and child select input respectively.</p>
<p>3. Add a class to the &#8216;&lt;option&gt;&#8217;s of the child list box. The class name will be the value of it&#8217;s parent &#8216;&lt;option&gt;&#8217; in parent listbox with a &#8216;sub_&#8217; prefix.<br />
Suppose, in parent listbox there is an item &#8220;Flower&#8221;. Its value is &#8216;fl&#8217;:</p>
<p style="background-color:#eeeeee;">        &lt;option value=&#8217;fl&#8217;&gt;Flower&lt;/option&gt;</p>
<p>    When the item &#8220;Flower&#8221; will be selected, only 3 items should be visible in child listbox. These 3 items should hold the class name &#8216;sub_fl&#8217;:</p>
<p style="background-color:#eeeeee;">        &lt;option class=&#8221;sub_fl&#8221; value=&#8221;1&#8243;&gt;Rose&lt;/option&gt;<br />
&lt;option class=&#8221;sub_fl&#8221; value=&#8221;2&#8243;&gt;Sunflower&lt;/option&gt;<br />
&lt;option class=&#8221;sub_fl&#8221; value=&#8221;3&#8243;&gt;Orchid&lt;/option&gt;</p>
<p>4. Now you are ready. On &#8216;$(document).ready&#8217; event of Jquery, run the function to associate your list boxes.</p>
<p style="background-color:#eeeeee;">       $(document).ready(function()<br />
{<br />
makeSublist(&#8216;parentID&#8217;,'childID&#8217;, false);<br />
});</p>
<p>5. Enjoy <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Hi friend,<br />
2nd version of this script is published with some addition and modification.<br />
visit the new version <a href="http://www.ajaxray.com/blog/2007/11/08/jquery-controlled-dependent-or-cascading-select-list-2/">here</a>.<br />
Thanks.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/php4bd.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/php4bd.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/php4bd.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/php4bd.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/php4bd.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/php4bd.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/php4bd.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/php4bd.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/php4bd.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/php4bd.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=php4bd.wordpress.com&amp;blog=1177412&amp;post=3&amp;subd=php4bd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://php4bd.wordpress.com/2007/07/15/javascript-controlled-dependent-or-cascading-select-list/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1529c12e371e2e39c92230d292bdd77d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">anisniit</media:title>
		</media:content>
	</item>
	</channel>
</rss>
