Javascript Phone Number Entry

by Admin 4. July 2009 07:35
Bookmark and Share

Here is a small function I wrote to only allow numeric values to be entered into text boxes used for phone number entry.

 

function numbercheck(n){
	var code = n.charCode? n.which: n.keyCode;
	if(code !=8 && code !=9){//allow backspace & tab
		if(code<48 || code > 57){
			return false;
		}		
	}
}

In the second line, n.charCode isn't valid in Internet Explorer, so this provides a quick browser check. If n.charCode returns a value this must not be IE, therefore n.which is also valid.Other than that, IE uses n.keyCode. Since we want to allow tab and backspace, we check for 8 or 9 which are the Javascript key codes tied to those buttons. We also want to allow for key codes between 48 and 57 which are all of the number keys.

 

We tie this function to the input boxes onKeyPress attribute like the example below and thats it.





Tags:

My love- My 2006 Nissan Sentra SER Spec-V Turbo

by Admin 3. July 2009 17:25
Bookmark and Share

So.. I have a turboed Sentra and it is GREAT.

I bought this car in late 2008 bone stock. I decided not to go my normal route and put lowering springs, tint, intake etc...

Sometime in March, april?, A friend of mine from myspecv.com came over and pretty much did most of the install since it was my first time but I definately learned alot from it. I got my kit used but it was in good condition. Here are the details:

Turbonetics T3/T4 .57 Trim .63 A/R Stage 3 turbo

Treadstone intercooler piping kit.

38mm Tial Wastegate &  Tial Blow off Valve

VAFC 2 for tuning from my maxima alongside a Zeitronix Zt-2 Wideband.

Check out my photogallery for pics of the internals.

Anyway, the install took about 2 days. both days we started around 6pm and went to almost 6am. I would do it again anyday!

Few weeks later I went to add on a full 3-inch exhaust system and a vacuum manifold kit but thats little. After about 10k miles, I'm still running the stock clutch and it still grabs great. I even took it to the track.

On to the Vids:

 

 

 


Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Marcell Scarlett


My name is Marcell. I am 21 years old and I work full time as a Web Developer. I love computers, cars and the Web.

Social Networks

  • facebook
  • myspace
  • twitter
  • linkedin
  • youtube


Category list

None

Tag cloud

    RecentPosts

    Page List