//Script to find letter of the alphabet
//It runs with no errors on page but I can't get an input box to
//come up.
function isInAlphabet (theCharacter) {
if ((theCharacter = 'A') || (theCharacter = 'z')) {
theAnswer = true;
} else {
theAnswer = false;
}
return theAnswer;
}
// This code is to enter a character to find if it is a letter of
// The alphabet or not
function alphabetCheck () {
var someInput;
var aResult;
someInput = window.prompt('Please enter a single character ','');
// you need to pass a character to your function for checking, of course the prompt will allow more than a single character
aResult = inAlphabet(someInput);
document.open();
document.write('The answer to whether ' + someInput + ' is in the alphabet is ' + aResult);
document.close();
}
Main Topics
Browse All Topics





by: ZvonkoPosted on 2005-06-15 at 11:29:12ID: 14224361
You do not pass the character as parameter:
aResult = inAlphabet(someInput);