|
|
|
5 Little Known Ways To Generate Free Traffic
Most people have the notion that generating traffic is a one-off event, and it involves spending huge sums of money on advertising.
Nothing can be further from the truth.
First of all, it's possible to open up streams of autopilot...
Examining the Substance of Studio MX
To all web designers out there, this article is for you! I guess you already heard about Studio MX (I think so!) – the ideal bundle for professional web designers, bringing together Dreamweaver MX for page design, Flash MX for animation and...
Natalie Bodrova
A way to increase Your repeat Traffic. Copyright by Natalie Bodrova. Avoid slow downloading pages. Make your web site easy to navigate, with easy accessibility to each of your page and a great layout. Update your site on a regular basis....
Now you have a Web site. Have you ever heard of accessibility?
An accessible Web site is easily approached, easily understood, and useable for all. There are accessibility standards set forth by the World Wide Web Consortium, which all sites should adhere to as much as possible.
Web site owners should be...
What Could Be Worse Than Your Viewers Not Seeing Your Site Display Properly?
What if they never get to your site to see it?
If you want your site listed on search engines then make sure that you have correct HTML code. Many search engines cannot properly catalog or index a site that has HTML errors. This can greatly...
|
|
| |
|
|
|
|
Validating Numerical Input with JavaScript
What? Make a mistake entering data? Who me? NO WAY! Right.
Every form of data input by a user should be validated in some form or fashion. If you get
clean data in, you won't get garbage out. This tutorial is going to explain how to validate
numerical data entered into a form using JavaScript.
First, let us begin with the code to insert the JavaScript into your HTML document.
Place these lines between the and tags.
This line tells the web browser to expect some JavaScript code and signal the beginning of
the script:
So now the format should look something like this:
My Title
Now on to validating the numerical input.
First we will create a function with one arument:
function validate(mydata){
These lines will test for a blank enty then prompt the user for input:
if (mydata == ""){ alert("Please enter a number.") }
Next we will create a for loop which will look at each character in the data until it
reaches the end:
for(var i=0;i < mydata.length;i++){
Now create a variable and assign the counter variable value to it:
var mydigit = mydata.charAt(i)
To screen out symbols, punctuation, and letters, place an if statement in the loop:
if(mydigit < "0" || mydigit > "9"){
The || in the if statement scans for both conditions.
The next line will alert the user to any mistakes he/she has made:
alert(mydigit + " is not a number.")
Here is the complete code including HTML: ============================================= Numerical Validation
| | | | | | |