Validate U.S Phone Numbers using JavaScript Regular expression.

photo credit: aussiegall

Continuing with our JavaScript regular expression series today we will discuss JavaScript regular expression to validate U.S phone number. Previously we talked about validating email , Social Security number and zip code using JS regex.
In today’s post I’ll show you how to use JavaScript regular expression to validate U.S [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Validate Zip code using JavaScript Regular expression

Continuing with my series of JavaScript regular expression today we will see how easy it is to validate zip code using regular expression in JavaScript. Previously we talked about validating email and Social Security number using JS regex.
In today’s post I’ll show you how to use JavaScript regular expression to validate zip code. Let [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

More JavaScript Regular Expressions

When I wrote the JS regular expression article last week I had no idea that it will attract so many visitors. Not only did so many people read this post, many more visited my blog searching for other regular expressions. So I decided to write few more posts about JavaScript regular expressions and how to [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Validate email address using JavaScript regular expression

Last month I wrote about regular expressions in Java, today I’ll show you how to use regular expression in JavaScript to validate email address.
Here is the code to validate email address in JavaScript using regular expression.
function validateEmail(elementValue){ var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; return emailPattern.test(elementValue); }

Explanation:
The argument to this method is [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Set focus on the first text field of HTML form.

A HTML form is a very good channel that you can offer to your visitors to contact you. An aesthetically appealing form encourages user to fill and submit it. It is equally important to make the form as user friendly as possible. Today I’ll share a small JavaScript function that will set the focus on [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Sort numbers in Javascript array

Sorting an array in Javascript is a snap.
You create an array and then call sort() method on that array. The Javascript sort() method sorts an array in lexicographical order. This method is very useful in sorting alphanumeric values of an array. However, sort() will not work if the array consists of numeric values. Because [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Compress JavaScript and CSS files to optimize website speed.

Referencing external JavaScript and/or CSS files from a web page considerably increases the load time. As a rule of thumb remember that each external file requires additional HTTP request by the browser, hence the time to render a page will increase. Every web developer worth their salt should make optimization their priority. Fortunately, since this [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Improve your JavaScript code.

Christian Heilmann compiled a list of seven rules for unobtrusive JavaScript. I think it is a must read for beginner JavaScript developers. Even if you are a highly experienced JavaScript developer this article may give you few tips to improve. To me the most important rule is this article is the first one, “Do [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

Display external RSS feeds on your website.

You have designed a beautiful website. But you still do not get a lot of loyal visitors. The problem may not be your design, it may be the static content that is turning the visitors off. If you do not update your website regularly chances are people may not visit your website. Why would someone [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking

#1 Programming Language - Java

According to TIOBE Programming Community Index Java is still the #1 programming language. TIOBE Index gives an indication of the popularity of a programming language and is updated monthly.
The ratings are calculated by counting hits of the most popular search engines.
Ruby moved up from 13th to 10th position.
Following is the list of top 10 [...]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • Digg
  • del.icio.us
  • Reddit
  • Sphinn
  • blinkbits
  • NewsVine
  • Smarking