|
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"

Google Now Searches JavaScript iProgrammer A big problem is how search bots deal with dynamic content - and JavaScript/Ajax is a tough one to solve. For example, you could have a page that never used a URL to move to another page but simply refreshed its contents either every so often or when ... |
WSO2 to Present Technical Webinar on Using Jaggery as a Server-Side JavaScript ... San Francisco Chronicle (press release) WSO2 webinar on May 31, explores how Jaggery provides an intuitive pure JavaScript server-side scripting engine for flexible Web application development and deployment Palo Alto, CA (PRWEB) May 24, 2012 Developing a Web application today is like ... |
![]() The Virginian-Pilot | Teen admits to Chesapeake attack on ex-NFL player The Virginian-Pilot In order to get the best experience with our full-size images, you should enable JavaScript in your browser. Ed Beard, a South Norfolk native and high school star, played for the San Francisco 49ers. Ed Beard, 71, suffered a concussion, ... |
![]() Sydney Morning Herald | Billy Slater and Storm show Broncos why they are still No.1 Herald Sun Video Video Video Image Please install the latest Flash player [To view Flash please enable JavaScript and Flash.] Please install the latest Flash player [To view Flash please enable JavaScript and Flash.] Please install the latest Flash player [To ... Anthony Griffin laments poor performance as Storm thrash Broncos 34-10 at AAMI ... |
Park of Animatronic Dinosaurs Opening in NJ ABC News Javascript is not enabled on your browser. Please enable javascript to use the community features on this page. If your browser does not support javascript, please visit our browser upgrade page for a list of supported web browsers. |