<?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>NewSourceMedia Blog &#187; JS Forms</title>
	<atom:link href="http://newsourcemedia.com/blog/category/javascripts/js-forms/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Fri, 30 Dec 2011 04:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Javascript Non Alphanumeric Characters Regex</title>
		<link>http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/</link>
		<comments>http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[JS Forms]]></category>
		<category><![CDATA[alph]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[alphabetic]]></category>
		<category><![CDATA[alphanumeric]]></category>
		<category><![CDATA[alphnumeric]]></category>
		<category><![CDATA[and]]></category>
		<category><![CDATA[hyper]]></category>
		<category><![CDATA[hypertext]]></category>
		<category><![CDATA[javascript examples]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[letters]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[numeral]]></category>
		<category><![CDATA[numeric]]></category>
		<category><![CDATA[only]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2006/12/28/javascript-non-alphanumeric-characters-regex/</guid>
		<description><![CDATA[Using javascript regular expressions to stop users from entering non-aphanumeric characters or white spaces Say you want to stop users from entering non-aphanumeric characters or white spaces. Using regular expressions would be the easiest method: Here is my javascript code: &#8230; <a href="http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Using javascript regular expressions to stop users from entering non-aphanumeric characters or white spaces
<span id="more-175"></span>

Say you want to stop users from entering non-aphanumeric characters or white   spaces.

Using regular expressions would be the easiest method:

Here is my javascript code:

<code>&lt;script language="Javascript"&gt;
function alphaNumericCheck(){
var regex=/^[0-9A-Za-z]+$/; //^[a-zA-z]+$/
if(regex.test(document.add_data.password.value)){
alert("Good")
return true;
} else {
alert("Please fix: password")
return false;
}
}
&lt;/script&gt; </code>
For numbers only use /^[0-9]+$/

For mixed text and numbers, with spaces /^[0-9a-zA-Zs]+$/

Here are more useful regular expressions:

<code>[a-zA-Z] any letter
d any number; same as [0-9]
D any NOT number; same as [^0-9]
w any alphanumeric character; same as [a-zA-Z-0-9_]
W any NON-alphanumeric character; same as [^a-zA-Z0-9_]
s any whitespace (tab, space, newline, etc...)
S any NON-whitespace
n newline
t tab</code>

To view a full html sample of the above code click the links below using regular   expressions in JavaScript]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/javascript-non-alphanumeric-characters-regex/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Javascript Email Validation Form</title>
		<link>http://newsourcemedia.com/blog/javascript-email-validation-form/</link>
		<comments>http://newsourcemedia.com/blog/javascript-email-validation-form/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[JS Forms]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[save.]]></category>
		<category><![CDATA[using]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2006/12/28/javascript-email-validation-form/</guid>
		<description><![CDATA[Check user email address forms to make sure they are valid using JavaScript before saving their info. The JavaScript code is provided here. The function below checks if the content has the general syntax of an email. This means that &#8230; <a href="http://newsourcemedia.com/blog/javascript-email-validation-form/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Check user email address forms to make sure they are valid using JavaScript before saving their info. The JavaScript code is provided here.
<span id="more-177"></span>

The function below checks if the content has the general syntax of an email.

This means that the input data must contain at least an @ sign and a dot (.). Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign:

<pre lang="javascript"><script language="Javascript">
function checksubmit()
{
apos=document.add_data.email.value.indexOf("@")
dotpos=document.add_data.email.value.lastIndexOf(".")
if (document.add_data.email.value == "" || apos<1 || dotpos-apos<2)
{
alert("Please fix: email")
document.add_data.email.focus()
return false
}
return true
}
</script> </pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/javascript-email-validation-form/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Address Auto-Fill Ckeck Box</title>
		<link>http://newsourcemedia.com/blog/address-auto-fill-ckeck-box/</link>
		<comments>http://newsourcemedia.com/blog/address-auto-fill-ckeck-box/#comments</comments>
		<pubDate>Sat, 28 Feb 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JS Forms]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[autofill]]></category>
		<category><![CDATA[check box]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/02/27/address-auto-fill-ckeck-box/</guid>
		<description><![CDATA[Javascript code that automatically fills in the address in all places needed on the page after just once entering it and selecting the check box. Introduction: I ran across this code when working on a registration product site. The goal &#8230; <a href="http://newsourcemedia.com/blog/address-auto-fill-ckeck-box/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Javascript code that automatically fills in the address in all places needed on the page after just once entering it and selecting the check box.
<span id="more-213"></span>

<span class="contitle">Introduction:</span>

I ran across this code when working on a registration                        product site. The goal is to save the user's time by not                        having them fill in the same address over and over, if the                        address for there billing is the same as the mailing address.

You can view a working form by <a href="http://newsourcemedia.com/Tutorials/JS-AddressCkBox.html" target="_blank">clicking                        here</a>.
<p class="contitle">Source Code</p>

<pre lang="js">
<html>
<title></title>
<head>
<script type="text/javascript" language="javascript">
function set_billing(box)
{
var f = box.form, b_which = box.checked, from_el, to_el, i = 0;
var fld_name = new Array('city' , 'state');
while (from_el = f[fld_name[i]])
{
to_el = f['bill' fld_name[i ]];
to_el.value = b_which ? from_el.value : '';
if (to_el.readOnly != null)
to_el.readOnly = b_which ? true : false;
else to_el.onfocus = b_which ? function() {this.blur();
}
: null;
}
}
</script>
</head>
<body>
<form>
<table>
<tr>
<td align="right">
<strong>Mailing Address</strong><br>
City: <input name="city" type="text" id="city" onchange="set_billing(billingaddrsame)"><br>
State: <input name="state" type="text" id="state" onchange="set_billing(billingaddrsame)"><br>
<strong>Billing Address</strong><br>
( same as above)
<input type="checkbox" name="billingaddrsame" onclick="set_billing(this)"><br>
City: <input name="billcity" type="text" id="billcity"><br>
State: <input name="billstate" type="text" id="billstate"><br>
</td>
</tr>
</table>
</form>
</body>
</html>
</pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/address-auto-fill-ckeck-box/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Telephon Check Box</title>
		<link>http://newsourcemedia.com/blog/telephon-check-box/</link>
		<comments>http://newsourcemedia.com/blog/telephon-check-box/#comments</comments>
		<pubDate>Sat, 28 Feb 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[JS Forms]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[autofill]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[enter.]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[telephone]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/02/27/telephon-check-box/</guid>
		<description><![CDATA[Javascript code that automatically fills in the telephone number in all places needed after just once entering it and selecting a check box. Introduction: I ran accross this code when working on a registration product site. The goal is to &#8230; <a href="http://newsourcemedia.com/blog/telephon-check-box/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Javascript code that automatically fills in the telephone number in all places needed after just once entering it and selecting a check box.
<span id="more-214"></span>
<span class="contitle">Introduction:</span>

I ran accross this code when working on a registration                        product site. The goal is to save the user's time by not                        having them fill in the same telephone number over and over,                        if the number is the same as other data fields.

You can view a working form by <a href="http://newsourcemedia.com/Tutorials/JS-TeleCheckBox.html" target="_blank">clicking                        here</a>.
<p class="contitle">Source Code</p>
<pre lang="html">
<html>
<head>
<title>NSM | Tele Check Box</title>
</head>
<body>
<form>
Home Telephone:
<input name="home_phone" type="text" size="14" maxlength="12">
<br>
Work Telephone:
<input name="work_phone" type="text" size="14" maxlength="12">
<input type="checkbox" name="same_mail" onClick="work_phone.value=(this.checked)?home_phone.value:''">
(check if same as home number)
</form>
</body>
</html>
</pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/telephon-check-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
