<?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>Sumit Gupta &#187; Javascript</title>
	<atom:link href="http://www.sumitgupta.net/category/programming/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sumitgupta.net</link>
	<description>bookmarking my life</description>
	<lastBuildDate>Wed, 08 Feb 2012 11:23:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Short Note: Colorbox moving Close button on Top right</title>
		<link>http://www.sumitgupta.net/short-note-colorbox-moving-close-button-on-top-right/</link>
		<comments>http://www.sumitgupta.net/short-note-colorbox-moving-close-button-on-top-right/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 11:23:48 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Colorbox]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=550</guid>
		<description><![CDATA[By default Colorbox Close button is on Bottom Right. However moving it back to top is as simple as changing Position of div from bottom to top. All I have done is change bottom: x to top: x for all child of cboxContent class. which include cboxLoadedContent, cboxTitle, cboxCurrent, cboxSlideshow, ,cboxPrevious ,cboxNext,cboxClose Note for myself, and those who find it [...]]]></description>
			<content:encoded><![CDATA[<p>By default Colorbox Close button is on Bottom Right. However moving it back to top is as simple as changing Position of div from bottom to top. All I have done is change bottom: x to top: x for all child of cboxContent class. which include cboxLoadedContent, cboxTitle, cboxCurrent, cboxSlideshow, ,cboxPrevious ,cboxNext,cboxClose</p>
<p>Note for myself, and those who find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/short-note-colorbox-moving-close-button-on-top-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selecting menu item using Javascript</title>
		<link>http://www.sumitgupta.net/selecting-menu-item-using-javascript/</link>
		<comments>http://www.sumitgupta.net/selecting-menu-item-using-javascript/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 19:55:41 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Concept/algorithm]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=487</guid>
		<description><![CDATA[Okay, I create a pure CSS menu that use UL/LI structure to maintain the child relationship. All was great with this menu except that when you are on any of menu item page it doesn&#8217;t highlight that menu item explicitly. If you consider this it is not a big deal. What you can do is [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, I create a pure CSS menu that use UL/LI structure to maintain the child relationship. All was great with this menu except that when you are on any of menu item page it doesn&#8217;t highlight that menu item explicitly. If you consider this it is not a big deal. What you can do is simply, iterate through the Menu Items which are probably in LI A tags. Once you iterate, find the URL in A tag and match the Page URL with the Menu ITEM link. If they match change the Class of respective LI or A as your liking.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> path <span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">pathname</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/User/&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>path <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span>
        path<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Userhome.aspx&quot;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#mainemnu a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> path.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;submenuitem&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//it is sub menu</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selectedmenu&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selectedmenu&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>That was a simple Jquery Driven Javascript function that I call in Document ready function of Jquery.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/selecting-menu-item-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET JavascriptSerializer for Array</title>
		<link>http://www.sumitgupta.net/asp-net-javascriptserializer-for-array/</link>
		<comments>http://www.sumitgupta.net/asp-net-javascriptserializer-for-array/#comments</comments>
		<pubDate>Sat, 28 May 2011 09:52:51 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[VB.NET/VB]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Serialize]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=484</guid>
		<description><![CDATA[I need to throw some database entry which are as simple as TIME, for this I got a string array in my ASP.NET code behind. I was throwing this String Array in JSON format after using JavascriptSerialize.Serialize method and it is making not so perfect Json script. I said it is not making perfect json [...]]]></description>
			<content:encoded><![CDATA[<p>I need to throw some database entry which are as simple as TIME, for this I got a string array in my ASP.NET code behind. I was throwing this String Array in JSON format after using JavascriptSerialize.Serialize method and it is making not so perfect Json script. I said it is not making perfect json because the expect result for me was something like this:</p>
<p>["10:20","10:30","10:40"]</p>
<p>but it was returing something like</p>
<p>{&#8220;d&#8221;:&#8221;[\"10:20\",\"10:30\",\"10:40\"]&#8220;}</p>
<p>the difference is that it is converting the array in to string, however the ideal result can be</p>
<p>{&#8220;d&#8221;:["10:20","10:30","10:40"]}</p>
<p>But we cannot change that functionality now, so what I realise we should use the eval function of javascript to make our Jquery or whatever JSON parse you are using. So my Jquery code looks like</p>
<blockquote>
<p>&#8230;.</p>
<p>success: function(data) {<br /> var items = [];<br /> $.each(data, function(ind, val) {<br /> var myobject = eval(val);<br /> $.each(myobject, function(i, v) {                    <br /> items.push(&#8216;&lt;option value=&#8221;&#8216; + v + &#8216;&#8221;&gt;&#8217; + v+ &#8216;&lt;/option&gt;&#8217;);<br /> });<br /> });<br /> }</p>
<p>&#8230;</p>
</blockquote>
<p>this convert the String to Javascript object using Eval function. Easy enough !!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/asp-net-javascriptserializer-for-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: New Presentation</title>
		<link>http://www.sumitgupta.net/javascript-new-presentation/</link>
		<comments>http://www.sumitgupta.net/javascript-new-presentation/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 09:46:30 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Blog: My thoughts]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/javascript-new-presentation/</guid>
		<description><![CDATA[We all have experienced some cool effects while we do web surfing. Its Twitter, Facebook, Google, Windows Live website, whatever you name it, they all use great web interface easy and to the point user interaction. This all belongs to one unified solution Javascript. I have been using JS since I start web programming. I [...]]]></description>
			<content:encoded><![CDATA[<p>We all have experienced some cool effects while we do web surfing. Its Twitter, Facebook, Google, Windows Live website, whatever you name it, they all use great web interface easy and to the point user interaction. This all belongs to one unified solution Javascript. I have been using JS since I start web programming. I found working with Javascript is second best option after working on XNA Game framework. It wasn’t that good since start, but I really blame it on Jquery that it really make something which is good to something great. Recently I am using lot of Jquery modules and functions. This not only the presentation of our web work but it also reduce work to more organized way of coding. </p>
<p>However the JQuery is good in itself, but I realise that it depends on few things, and one of those is good HTML, if you are using Javascript especially with these libraries make sure you first validate your HTML. You don’t necessarily need to validate using HTML validator such as W3C validation, but a symmetric HTML is what you need. With Libraries like Jquery, I really wonder if we need Flash and Silverlight anymore ? Though I love to work on silverlight, never got a chance to use that in my project. But from Banner Flash to Jquery Banner, I opt for Jquery Banner, because they are simpler and faster to work. It took me 2 hrs to ingrate Paypal on HTML site, without making any new public page on site, as I just use Jquery Dialog to show the form and proceed with order. Client didn’t expect that and they are excited to get it that way. It make their money worth, and it ease out my work to make a form in template. which is indeed quite a work as compare to plain HTML form with no style at all. </p>
<p>If you are looking for web programming career, Javascript is must to learn with HTML. Without this if you want to be a programmer, then you won’t be. If you want any help on concept I am happy to help as it also help me learn more and more. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/javascript-new-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colorbox: Alternative for Lightbox</title>
		<link>http://www.sumitgupta.net/colorbox-alternative-for-lightbox/</link>
		<comments>http://www.sumitgupta.net/colorbox-alternative-for-lightbox/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 17:41:58 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Colorbox]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Lightbox]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=422</guid>
		<description><![CDATA[I have got lot of queries on my Lightbox + Videobox merge code. But over time I realize my merged code is not good enough as now with dynamic web, that code is limited. It is said to see such great software didn&#8217;t evolve much. But as a developer we cannot stop for one code [...]]]></description>
			<content:encoded><![CDATA[<p>I have got lot of queries on my Lightbox + Videobox merge code. But over time I realize my merged code is not good enough as now with dynamic web, that code is limited. It is said to see such great software didn&#8217;t evolve much. But as a developer we cannot stop for one code and hence here is great alternative for virtually all sort of Lightbox effect for anything, It is called Colorbox (<a href="http://colorpowered.com/colorbox/" target="_blank">http://colorpowered.com/colorbox/</a>). I used it so far to display, Tell a Friend form, Dynamic Form created based on User Input, a Cool Slideshow. Not much, but all looks great with its control using Jquery.</p>
<p>I am really a great fan of Jquery, it change the web developer&#8217;s life to make Great website out of Good websites. Long Live JQuery and ColorBox. Thanks for sharing it with us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/colorbox-alternative-for-lightbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spell Checker for Web Application (PHP on Linux )</title>
		<link>http://www.sumitgupta.net/spell-checker-for-web-application-php-on-linux/</link>
		<comments>http://www.sumitgupta.net/spell-checker-for-web-application-php-on-linux/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 02:25:21 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Javascript Spell Checker]]></category>
		<category><![CDATA[PHP Spell checker]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=82</guid>
		<description><![CDATA[Well try this http://activecampaign.com/activespell/ free spell checker, it use backend pSpell component installed on PHP to work, but is very good spell checker for your HTML editors and TextArea boxes. I have used it in past and found it easy to install.]]></description>
			<content:encoded><![CDATA[<p>Well try this http://activecampaign.com/activespell/ free spell checker, it use backend pSpell component installed on PHP to work, but is very good spell checker for your HTML editors and TextArea boxes. I have used it in past and found it easy to install.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/spell-checker-for-web-application-php-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LightBox Vs VideoBox Vs Custom Code</title>
		<link>http://www.sumitgupta.net/lightbox-vs-videobox-vs-custom-code/</link>
		<comments>http://www.sumitgupta.net/lightbox-vs-videobox-vs-custom-code/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 02:49:27 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Fullscreen video and Image display]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[vidbox]]></category>
		<category><![CDATA[videobox]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=78</guid>
		<description><![CDATA[Recently I was given a task to make LightBox and VideoBox work on same page, where we have Images and Video to show. However, Videobox is inspired by Lightbox as per developer, they are not compatible with each other. The reason I found is that they share few variable and hence they are breaking each other&#8217;s code. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was given a task to make <a title="LightBox" href="http://www.huddletogether.com/projects/lightbox2/" target="_blank">LightBox</a> and <a title="Video Box" href="http://videobox-lb.sourceforge.net/" target="_blank">VideoBox</a> work on same page, where we have Images and Video to show. However, Videobox is inspired by Lightbox as per developer, they are not compatible with each other. The reason I found is that they share few variable and hence they are breaking each other&#8217;s code. Now since we need functionality to be done, I have give to find a quick alternative solution..When my company said quick solution they mean a solution in next 1 hr.</p>
<p>Let us check what we can do..Lightbox, read image tag with a tag and show image based on those, and this is what Videobox do, it read for &#8220;rel=vidbox&#8221; in anchor tag, and then it detect the type of video source to display the item in bigger div. What I do is I modify it to recognize images as well, i.e. if we put rel=&#8221;vidbox&#8221; in anchor tag for your images, (something we do in lightbox) my modified VideoBox code will read and check for extension jpg, jpeg, gif,png and if found i write &#8220;custom code&#8221; in variable this.other to show img tag instead of SWFObject or other.</p>
<p>Now VideoBox is no more a video only box, and it can handle Images for me as well <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p><a title="Download for Modified video Box" href="http://www.sumitgupta.net/download/videobox.zip">Download modified VideoBox Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/lightbox-vs-videobox-vs-custom-code/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Javascript Replace Function</title>
		<link>http://www.sumitgupta.net/javascript-replace-function/</link>
		<comments>http://www.sumitgupta.net/javascript-replace-function/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 07:55:31 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=72</guid>
		<description><![CDATA[I just have been asked, &#8220;Does, Javacript string.replace function replace string only once?&#8221;. I said, &#8220;No&#8221;. But when I test the function I was wrong. Then did a search on internet and found that Javascript&#8217;s Replace function is not a String Replacement function as in anyother language, but it is regular experssion based Replacement function. [...]]]></description>
			<content:encoded><![CDATA[<p>I just have been asked, &#8220;Does, Javacript string.replace function replace string only once?&#8221;. I said, &#8220;No&#8221;. But when I test the function I was wrong. Then did a search on internet and found that Javascript&#8217;s Replace function is not a String Replacement function as in anyother language, but it is regular experssion based Replacement function. Once it read this, I am sure why I am wrong, and here is what you need to do in term of using String.Replace function to work as Replace function (for string) to replace every instanace.</p>
<p>  Simply change your JS line as</p>
<p>var str =&#8217;this is string in which I will replace is with ab&#8217;;<br />
str = str.replace(&#8216;is&#8217;,'ab&#8217;);</p>
<p>To this one&#8230;</p>
<p>var str =&#8217;this is string in which I will replace is with ab&#8217;;<br />
str = str.replace(/is/g,&#8217;ab&#8217;);</p>
<p>And you get a new string where all &#8220;is&#8221; got replaced with &#8220;ab&#8221;.  /is/g  is a regular expression syntax where  &#8221;is&#8221; is a string literal  we are going to replace and &#8220;g&#8221; signify that it will be replaced globally.</p>
<p>Hope it will help you in your search and replace <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/javascript-replace-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating distance</title>
		<link>http://www.sumitgupta.net/calculating-distance/</link>
		<comments>http://www.sumitgupta.net/calculating-distance/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 16:05:37 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/?p=60</guid>
		<description><![CDATA[With increasing use of Map service such as google, yahoo and MSN one often need to calculate distance between two location. This can be done many ways I suppose. However, to calculate the short distance we can perform calculation based on longitude and latitude values of those two location.  However, it is simply a math [...]]]></description>
			<content:encoded><![CDATA[<p>With increasing use of Map service such as google, yahoo and MSN one often need to calculate distance between two location. This can be done many ways I suppose. However, to calculate the short distance we can perform calculation based on longitude and latitude values of those two location.</p>
<p>  However, it is simply a math formula you need to learn but you should now the coordinates of location as well. Here is one beautiful article and Javascript method do to that</p>
<p><a href="http://www.movable-type.co.uk/scripts/latlong.html">http://www.movable-type.co.uk/scripts/latlong.html</a></p>
<p>This script explain all its working and from where it is drived. Such a nice place to learn something new <img src='http://www.sumitgupta.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/calculating-distance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Filling Text Boxes for Testing</title>
		<link>http://www.sumitgupta.net/filling-text-boxes-for-testing/</link>
		<comments>http://www.sumitgupta.net/filling-text-boxes-for-testing/#comments</comments>
		<pubDate>Tue, 26 Dec 2006 05:55:11 +0000</pubDate>
		<dc:creator>Sumit Gupta</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sumitgupta.net/blog/2006/12/26/filling-text-boxes-for-testing/</guid>
		<description><![CDATA[It is often required to fillin the form on webpage so you can test the form submission action. For this I often need to put different value so I can recognize the values are coming good. Like I need to create PDF on the fly, In that I need to fill the form on web [...]]]></description>
			<content:encoded><![CDATA[<p>It is often required to fillin the form on webpage so you can test the form submission action. For this I often need to put different value so I can recognize the values are coming good. Like I need to create PDF on the fly, In that I need to fill the form on web page than generate the PDF as per data in web form, this consist of 30 field, so To place each field data correctly I need to fill the form again and again. Though data validation is not required and not there. But still to check if need data to be transfer.</p>
<p>Ã‚  So, I add this small JS code to do that for me, within body tag</p>
<p><em><strong>for (i = 0; i < document.forms[0].elements.length; i++) </strong></em></p>
<p><em><strong>{ </strong></em></p>
<p><em><strong>   if (document.Form1.elements[i].type == &#8220;text&#8221;) </strong></em></p>
<p><em><strong>{ </strong></em></p>
<p><em><strong>document.Form1.elements[i].value = document.Form1.elements[i].name; </strong></em></p>
<p><em><strong>} </strong></em></p>
<p><em><strong>}</strong></em></p>
<p>That solve my problem&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumitgupta.net/filling-text-boxes-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

