<?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>Web Development - Web Development Tutorial for Developer&#039;s, Asp.net Tutorial, PHP Development, Wordpress Integration &#187; Javascript</title>
	<atom:link href="http://www.solutions4ever.net/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutions4ever.net</link>
	<description>Web Development Solutions Provider</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:11:56 +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>Complete Form Validation Script</title>
		<link>http://www.solutions4ever.net/2010/08/complete-form-validation-script/</link>
		<comments>http://www.solutions4ever.net/2010/08/complete-form-validation-script/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 10:01:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=230</guid>
		<description><![CDATA[<p>The following code sample shows the complete ValidateContactForm function for the contact form.</p>
<p>function ValidateContactForm()
{
    var name = document.ContactForm.Name;
    var email = document.ContactForm.Email;
    var phone = document.ContactForm.Telephone;
    var nocall = document.ContactForm.DoNotCall;
    var what = document.ContactForm.Subject;
   ... <a href="http://www.solutions4ever.net/2010/08/complete-form-validation-script/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p>The following code sample shows the complete ValidateContactForm function for the contact form.</p>
<p>function ValidateContactForm()<br />
{<br />
    var name = document.ContactForm.Name;<br />
    var email = document.ContactForm.Email;<br />
    var phone = document.ContactForm.Telephone;<br />
    var nocall = document.ContactForm.DoNotCall;<br />
    var what = document.ContactForm.Subject;<br />
    var comment = document.ContactForm.Comment;</p>
<p>    if (name.value == &#8220;&#8221;)<br />
    {<br />
        window.alert(&#8220;Please enter your name.&#8221;);<br />
        name.focus();<br />
        return false;<br />
    }</p>
<p>    if (email.value == &#8220;&#8221;)<br />
    {<br />
        window.alert(&#8220;Please enter a valid e-mail address.&#8221;);<br />
        email.focus();<br />
        return false;<br />
    }<br />
    if (email.value.indexOf(&#8220;@&#8221;, 0) < 0)<br />
    {<br />
        window.alert(&#8220;Please enter a valid e-mail address.&#8221;);<br />
        email.focus();<br />
        return false;<br />
    }<br />
    if (email.value.indexOf(&#8220;.&#8221;, 0) < 0)<br />
    {<br />
        window.alert(&#8220;Please enter a valid e-mail address.&#8221;);<br />
        email.focus();<br />
        return false;<br />
    }</p>
<p>    if ((nocall.checked == false) &#038;&#038; (phone.value == &#8220;&#8221;))<br />
    {<br />
        window.alert(&#8220;Please enter your telephone number.&#8221;);<br />
        phone.focus();<br />
        return false;<br />
    }</p>
<p>    if (what.selectedIndex < 1)<br />
    {<br />
        alert(&#8220;Please tell us how we can help you.&#8221;);<br />
        what.focus();<br />
        return false;<br />
    }</p>
<p>    if (comment.value == &#8220;&#8221;)<br />
    {<br />
        window.alert(&#8220;Please provide a detailed description or comment.&#8221;);<br />
        comment.focus();<br />
        return false;<br />
    }<br />
    return true;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/08/complete-form-validation-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spacebar Check in TextBox Using Javascript</title>
		<link>http://www.solutions4ever.net/2010/02/spacebar-check-in-textbox-using-javascript/</link>
		<comments>http://www.solutions4ever.net/2010/02/spacebar-check-in-textbox-using-javascript/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 09:47:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=129</guid>
		<description><![CDATA[<p>Trim Function using java script.Validation for text box if there only space using java script.validation for space in text box using java script.</p>
<p>Solution:</p>
<p>Create A textbox with id txtname and a button id btntest and wite this function inside script tag.</p>
<p>function trim(string)
{
var a = string.replace(/^\s+/, &#8221;);
return a.replace(/\s+$/, &#8221;)
}
function TestTrim()
{</p>
<p>x = window.document.getElementById(&#8220;txtname&#8221;);
str=&#8221;Please  ... <a href="http://www.solutions4ever.net/2010/02/spacebar-check-in-textbox-using-javascript/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p>Trim Function using java script.Validation for text box if there only space using java script.validation for space in text box using java script.</p>
<p>Solution:</p>
<p>Create A textbox with id txtname and a button id btntest and wite this function inside script tag.</p>
<p>function trim(string)<br />
{<br />
var a = string.replace(/^\s+/, &#8221;);<br />
return a.replace(/\s+$/, &#8221;)<br />
}<br />
function TestTrim()<br />
{</p>
<p>x = window.document.getElementById(&#8220;txtname&#8221;);<br />
str=&#8221;Please Enter User Name&#8221;;<br />
if (trim(x.value)==&#8221;")<br />
{<br />
alert(str);<br />
x.select();<br />
x.focus();<br />
return false ;<br />
}<br />
}</p>
<p>And then call the function on c#(code behind page)<br />
btntest.Attributes.Add(&#8220;onclick&#8221;, &#8220;return TestTrim();&#8221;);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/spacebar-check-in-textbox-using-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Regular Expressions in ASP.NET</title>
		<link>http://www.solutions4ever.net/2010/02/regular-expressions-in-asp-net/</link>
		<comments>http://www.solutions4ever.net/2010/02/regular-expressions-in-asp-net/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 09:44:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=127</guid>
		<description><![CDATA[<p>Description </p>
<p>The source code show how to use Regular Expressions in C#. The code Functions written for Validation Alphabet, Alphanumeric, Integer, Positive Integer, Floating point numbers. You just cut copy these functions and use in any program.</p>
<p>Explanation of Regular Expressions:</p>
<p>Regular expressions are use to search specified in the source string.</p>
<p>Examples:</p>
<p>Pattern#1
Regex  ... <a href="http://www.solutions4ever.net/2010/02/regular-expressions-in-asp-net/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p><strong>Description </strong></p>
<p>The source code show how to use Regular Expressions in C#. The code Functions written for Validation Alphabet, Alphanumeric, Integer, Positive Integer, Floating point numbers. You just cut copy these functions and use in any program.</p>
<p><strong>Explanation of Regular Expressions:</strong></p>
<p>Regular expressions are use to search specified in the source string.</p>
<p><em>Examples:</em></p>
<p>Pattern#1<br />
Regex objNotNaturalPattern=new Regex(&#8220;[^0-9]&#8220;);</p>
<p>Pattern#2<br />
Regex objNaturalPattern=new Regex(&#8220;0*[1-9][0-9]*&#8221;);</p>
<p>Pattern#1 will match for strings other than 0 to 9.^ symbol is used for Specifying not condition.[] brackets if we are to give range values such as 0 &#8211; 9 or a-z or A-Z</p>
<p>eg. abc will return true</p>
<p>123 will return false.</p>
<p>Pattern#2 will match for string which are Natural Numbers.Natural numbers Are numbers which are always greater than 0.The pattern 0* tells that a natural Number can be prefixed with any number of zero&#8217;s or no zero&#8217;s.the next [1-9] tells that it should contain atleast one number from 1 to 9 followed by any numbers of</p>
<p>0-9&#8242;s</p>
<p>Eg. 0007 returns true whereas 00 will return false.</p>
<p>Basic things to be understood in RegEx:</p>
<p>&#8220;*&#8221; matches 0 or more patterns<br />
&#8220;?&#8221; matches single character<br />
&#8220;^&#8221; for ignoring matches.<br />
&#8220;[]&#8221; for searching range patterns.</p>
<p>More RegEx patterns in Next Article.</p>
<p><strong>Source Code:</strong></p>
<p>// Source Code starts<br />
using System.Text.RegularExpressions;<br />
using System;<br />
/*<br />
&lt;HowToCompile&gt;<br />
csc /r:System.Text.RegularExpressions.dll,System.dll Validation.cs<br />
&lt;/HowToComplie&gt;<br />
*/<br />
class Validation<br />
{<br />
public static void Main()<br />
{<br />
String strToTest;<br />
Validation objValidate=new Validation();<br />
Console.Write(&#8220;Enter a String to Test for Alphabets:&#8221;);<br />
strToTest=Console.ReadLine();<br />
if(objValidate.IsAlpha(strToTest))<br />
{<br />
Console.WriteLine(&#8220;{0} is Valid Alpha String&#8221;,strToTest);<br />
}<br />
else<br />
{<br />
Console.WriteLine(&#8220;{0} is not a Valid Alpha String&#8221;,strToTest);<br />
}<br />
}<br />
// Function to test for Positive Integers.<br />
public bool IsNaturalNumber(String strNumber)<br />
{<br />
Regex objNotNaturalPattern=new Regex(&#8220;[^0-9]&#8220;);<br />
Regex objNaturalPattern=new Regex(&#8220;0*[1-9][0-9]*&#8221;);<br />
return !objNotNaturalPattern.IsMatch(strNumber) &amp;&amp;<br />
objNaturalPattern.IsMatch(strNumber);<br />
}<br />
// Function to test for Positive Integers with zero inclusive<br />
public bool IsWholeNumber(String strNumber)<br />
{<br />
Regex objNotWholePattern=new Regex(&#8220;[^0-9]&#8220;);<br />
return !objNotWholePattern.IsMatch(strNumber);<br />
}<br />
// Function to Test for Integers both Positive &amp; Negative<br />
public bool IsInteger(String strNumber)<br />
{<br />
Regex objNotIntPattern=new Regex(&#8220;[^0-9-]&#8220;);<br />
Regex objIntPattern=new Regex(&#8220;^-[0-9]+$|^[0-9]+$&#8221;);<br />
return !objNotIntPattern.IsMatch(strNumber) &amp;&amp; objIntPattern.IsMatch(strNumber);<br />
}<br />
// Function to Test for Positive Number both Integer &amp; Real<br />
public bool IsPositiveNumber(String strNumber)<br />
{<br />
Regex objNotPositivePattern=new Regex(&#8220;[^0-9.]&#8220;);<br />
Regex objPositivePattern=new Regex(&#8220;^[.][0-9]+$|[0-9]*[.]*[0-9]+$&#8221;);<br />
Regex objTwoDotPattern=new Regex(&#8220;[0-9]*[.][0-9]*[.][0-9]*&#8221;);<br />
return !objNotPositivePattern.IsMatch(strNumber) &amp;&amp;<br />
objPositivePattern.IsMatch(strNumber) &amp;&amp;<br />
!objTwoDotPattern.IsMatch(strNumber);<br />
}<br />
// Function to test whether the string is valid number or not<br />
public bool IsNumber(String strNumber)<br />
{<br />
Regex objNotNumberPattern=new Regex(&#8220;[^0-9.-]&#8220;);<br />
Regex objTwoDotPattern=new Regex(&#8220;[0-9]*[.][0-9]*[.][0-9]*&#8221;);<br />
Regex objTwoMinusPattern=new Regex(&#8220;[0-9]*[-][0-9]*[-][0-9]*&#8221;);<br />
String strValidRealPattern=&#8221;^([-]|[.]|[-.]|[0-9])[0-9]*[.]*[0-9]+$&#8221;;<br />
String strValidIntegerPattern=&#8221;^([-]|[0-9])[0-9]*$&#8221;;<br />
Regex objNumberPattern =new Regex(&#8220;(&#8221; + strValidRealPattern +&#8221;)|(&#8221; + strValidIntegerPattern + &#8220;)&#8221;);<br />
return !objNotNumberPattern.IsMatch(strNumber) &amp;&amp;<br />
!objTwoDotPattern.IsMatch(strNumber) &amp;&amp;<br />
!objTwoMinusPattern.IsMatch(strNumber) &amp;&amp;<br />
objNumberPattern.IsMatch(strNumber);<br />
}<br />
// Function To test for Alphabets.<br />
public bool IsAlpha(String strToCheck)<br />
{<br />
Regex objAlphaPattern=new Regex(&#8220;[^a-zA-Z]&#8220;);<br />
return !objAlphaPattern.IsMatch(strToCheck);<br />
}<br />
// Function to Check for AlphaNumeric.<br />
public bool IsAlphaNumeric(String strToCheck)<br />
{<br />
Regex objAlphaNumericPattern=new Regex(&#8220;[^a-zA-Z0-9]&#8220;);<br />
return !objAlphaNumericPattern.IsMatch(strToCheck);<br />
}<br />
}<br />
// Source Code End</p>
<p>﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/regular-expressions-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Converting Strings to Numbers</title>
		<link>http://www.solutions4ever.net/2010/02/converting-strings-to-numbers/</link>
		<comments>http://www.solutions4ever.net/2010/02/converting-strings-to-numbers/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 09:43:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.solutions4ever.net/?p=125</guid>
		<description><![CDATA[<p> </p>
<p>How it works:
The argument of parseFloat must be a string or a string expression. The result of parseFloat is the number whose decimal representation was contained in that string (or the number found in the beginning of the string). If the string argument cannot be parsed as a decimal number,  ... <a href="http://www.solutions4ever.net/2010/02/converting-strings-to-numbers/" class="expert-read-more" >Read More</a>]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><em>How it works:</em><br />
The argument of <code>parseFloat</code> must be a string or a string expression. The result of <code>parseFloat</code> is the number whose decimal representation was contained in that string (or the number found in the beginning of the string). If the string argument cannot be parsed as a decimal number, the results will be different in different browsers (either <code>0</code> or <code>NaN</code>).</p>
<p><em>Examples</em> (comments in each line give the conversion results):</p>
<pre>parseFloat('1.45kg')  // 1.45
parseFloat('77.3')    // 77.3
parseFloat('077.3')   // 77.3
parseFloat('0x77.3')  // 0
parseFloat('.3')      // 0.3
parseFloat('0.1e6')   // 100000</pre>
<p><img src="http://localhost:1654/solutions4ever/FCKeditor/editor/images/spacer.gif" alt="" /><em><strong>parseInt</strong> syntax:</em>   <code><span>parseInt( 'string' [, base] )</span></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutions4ever.net/2010/02/converting-strings-to-numbers/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

