<?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>Technoreply &#187; Javascript</title>
	<atom:link href="http://www.technoreply.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technoreply.com</link>
	<description></description>
	<lastBuildDate>Mon, 25 Jul 2011 19:21:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to do French alphanumeric regular expression validation in ASP.NET</title>
		<link>http://www.technoreply.com/how-to-do-french-alphanumeric-regular-expression-validation-in-asp-net/</link>
		<comments>http://www.technoreply.com/how-to-do-french-alphanumeric-regular-expression-validation-in-asp-net/#comments</comments>
		<pubDate>Mon, 04 May 2009 23:53:20 +0000</pubDate>
		<dc:creator>Jevin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://technoreply.wordpress.com/?p=40</guid>
		<description><![CDATA[If you&#8217;re working on ASP.NET, you have realized that regular expression validation can come in handy more than one time. Also, regular expressions are very easy to implement (provided you have a good knowledge about it). Some days back, I &#8230; <a href="http://www.technoreply.com/how-to-do-french-alphanumeric-regular-expression-validation-in-asp-net/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re working on <strong>ASP.NET</strong>, you have realized that <strong>regular expression validation</strong> can come in handy more than one time. Also, regular expressions are very easy to implement (provided you have a good knowledge about it).</p>
<p>Some days back, I was faced with a small task. I had to make implement <strong>Javascript regular expression validation</strong> on a field. The requirement was simple; the field should have minimum three alphanumeric characters, including <strong>French characters</strong>. For you to have an idea, <strong>French characters</strong> include &#8220;<strong>accent aigu</strong>&#8221; and &#8220;<strong>accent grave</strong>&#8221; (you can read about <a title="French accents" href="http://en.wikipedia.org/wiki/Accent_aigu" target="_blank">French accents on wikipedia</a>).</p>
<p>Okay so I had the requirement and I was all set. I created a <strong>RegularExpressionValidator</strong> element on my <strong>ASP.NET</strong> page and I added &#8220;<strong>[a-zA-Z0-9 ]</strong>&#8221; as <strong>ValidationExpression</strong>. The code looked like this:</p>
<pre style="border:1px solid #c0c0c0;margin-bottom:15px;padding:10px;">&lt;asp:TextBox ID="txtName" runat="server" /&gt;
&lt;asp:RegularExpressionValidator ID="rexName" ControlToValidate="txtName"
  ValidationExpression="[a-zA-Z0-9 ][a-zA-Z0-9 ][a-zA-Z0-9 ]+"
  ErrorMessage="Please enter at least 3 alphanumeric characters." runat="server" /&gt;</pre>
<p>This worked perfectly. It matched three alphanumeric characters or more. But the problem was it was not matching any of the <strong>French characters</strong>. After some Google searching and some code trial and errors, I came up with this &#8220;<strong>[a-zA-ZÀ-ÿ0-9 ]</strong>&#8221; as <strong>ValidationExpression</strong>. This worked like a charm. The new code was like this:</p>
<pre style="border:1px solid #c0c0c0;margin-bottom:15px;padding:10px;">&lt;asp:TextBox ID="txtName" runat="server" /&gt;
&lt;asp:RegularExpressionValidator ID="rexName" ControlToValidate="txtName"
  ValidationExpression="[a-zA-ZÀ-ÿ0-9 ][a-zA-ZÀ-ÿ0-9 ][a-zA-ZÀ-ÿ0-9 ]+"
  ErrorMessage="Please enter at least 3 alphanumeric characters." runat="server" /&gt;</pre>
<p>If you can&#8217;t see the logic, let me explain. The code now matches</p>
<ul>
<li>all characters from a to z (lowercase invariants)</li>
<li>all characters from A to Z (uppercase invariants)</li>
<li>all characters from À to ÿ (all accent characers including French accents in uppercase and lowercase)</li>
<li>all digits from 0 to 9 (note that the requirement did not require the name to start with a non-digit)</li>
<li>whitespaces (whitespace was not catered for in the requirement)</li>
</ul>
<p>So there you go. You now have the <strong>regular expression validation</strong> for <strong>French characters</strong>. The beauty of <strong>regular expression validation</strong> is that it is hard to come up with, but it is very easy to implement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technoreply.com/how-to-do-french-alphanumeric-regular-expression-validation-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to make Google Map Marker non clickable</title>
		<link>http://www.technoreply.com/how-to-make-google-map-marker-non-clickable/</link>
		<comments>http://www.technoreply.com/how-to-make-google-map-marker-non-clickable/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 00:21:10 +0000</pubDate>
		<dc:creator>Jevin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://technoreply.wordpress.com/?p=32</guid>
		<description><![CDATA[If you have been working with Google map markers for a long time, you probably know that whatever map marker you place on the map is clickable by default. But what if I need a non-clickable marker? Easy, its in &#8230; <a href="http://www.technoreply.com/how-to-make-google-map-marker-non-clickable/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have been working with <strong>Google map markers</strong> for a long time, you probably know that whatever <strong>map marker</strong> you place on the map is <strong>clickable by default</strong>. But what if I need a <strong>non-clickable marker</strong>? Easy, its in the <strong>Google Maps API</strong>. Yes it is, but the documentation is not very straight forward.</p>
<p>Taking a look at the <strong>GMarker</strong> section in the <strong>Google Maps API</strong>, we realise that the <strong>constructor</strong> takes <strong>two arguments</strong>. <strong>GLatLng</strong> and <strong>GMarkerOptions</strong>. What we need is the <strong>GMarkerOptions</strong>, which specifies the <strong>map marker </strong>options. Taking a look at the <strong>GMarkerOptions</strong>, we see that the class has <strong>no constructor</strong>. It only has a list of <strong>properties</strong>. Among, the <strong>clickable property</strong>.</p>
<p>But how do we use those properties? A little bit of googling around gave me answer. It was found on the <a title="Google map marker GMarkerOptions non clickable" href="http://googlemapsapi.blogspot.com/2007/03/march-marker-madness-gmarkeroptions.html" target="_blank">Official Google Maps API Blog</a>. The solution is pretty simple. Just take a look on the code below and you will see what I mean.</p>
<pre style="border:1px solid #c0c0c0;margin-bottom:15px;padding:10px;">var markerOptions = {
clickable: false
};
var marker = new GMarker(new GLatLng(37.4419,-122.1419), markerOptions);
map.addOverlay(marker);</pre>
<p>As you can see, the code is very simple, but the <strong>documentation</strong> is not precise enough. Hope this helps you out. Just a note, <strong>map marker</strong> options should be separated by a comma.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technoreply.com/how-to-make-google-map-marker-non-clickable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>document.body.onload fix for IE</title>
		<link>http://www.technoreply.com/document-body-fix-for-ie/</link>
		<comments>http://www.technoreply.com/document-body-fix-for-ie/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 15:45:14 +0000</pubDate>
		<dc:creator>Jevin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://technoreply.wordpress.com/?p=14</guid>
		<description><![CDATA[If you are reading this, you are probably having problems with &#8220;document.body.onload&#8221; in your IE javascript code. I have had this problem a few days back and a Google search solved it. To fix it, just change your code from: &#8230; <a href="http://www.technoreply.com/document-body-fix-for-ie/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are reading this, you are probably having problems with &#8220;<strong>document.body.onload</strong>&#8221; in your <strong>IE</strong> <strong>javascript</strong> code. I have had this problem a few days back and a <strong>Google</strong> search solved it.</p>
<p>To fix it, just change your code from:</p>
<pre style="border:1px solid #C0C0C0;margin-bottom:15px;padding:10px;">document.body.onload = alert("Hello world");</pre>
<p>to:</p>
<pre style="border:1px solid #C0C0C0;margin-bottom:15px;padding:10px;">document.onload = alert("Hello world");</pre>
<p>It appears that <strong>document.body.onload</strong> does not work on <strong>IE</strong>. Before, when I loaded the page, I used to get  the error dialog &#8220;<strong>A Runtime Error has occured</strong>&#8221; saying &#8220;<strong>Error: Not implemented</strong>&#8220;. On debug in Visual Studio, I&#8217;d get &#8220;<strong>htmlfile: Not implemented</strong>&#8220;. All these error messages are not very clear, but fortunately, the faulty line of code was highlighted.</p>
<p>I have not yet researched about the difference(s) between <strong>document.body.onload</strong> and <strong>document.onload</strong> in <strong>Firefox</strong> (or <strong>IE</strong>), but if you&#8217;re only using a small piece of <strong>javascript</strong> code, you should be alright with this fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technoreply.com/document-body-fix-for-ie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

