Why am I getting the "undefined" in my txt box, I have tried everything! I am new here so I truly hope you are able to assist me...
Thanks
<html>
<head>
<title>Random Proverbs</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
quotes = new Array( ); // Initiated NEW ARRAY and also Added ( ) brackets
quotes[0] = "Laughter is the best medicine.";
quotes[1] = "Never look a gift horse in the mouth.";
quotes[2] = "One good turn deserves another.";
quotes[3] = "The early bird catches the worm.";
quotes[4] = "Two is company, three is a crowd.";
function changeQuote() {
var newQuote = quotes[Math.round(Math .random()+quote s.length)];
document.quotef orm.quote.value = newQuote;
}
var tick = setInterval(cha ngeQuote, 1000); // Add interval value to change the quote.
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="quoteform " action=""> // ADDED form name that was missing
<input type="text" size="50" name="quote" /><br />
</form>
</body>
</html>
Thanks
<html>
<head>
<title>Random Proverbs</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
quotes = new Array( ); // Initiated NEW ARRAY and also Added ( ) brackets
quotes[0] = "Laughter is the best medicine.";
quotes[1] = "Never look a gift horse in the mouth.";
quotes[2] = "One good turn deserves another.";
quotes[3] = "The early bird catches the worm.";
quotes[4] = "Two is company, three is a crowd.";
function changeQuote() {
var newQuote = quotes[Math.round(Math .random()+quote s.length)];
document.quotef orm.quote.value = newQuote;
}
var tick = setInterval(cha ngeQuote, 1000); // Add interval value to change the quote.
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="quoteform " action=""> // ADDED form name that was missing
<input type="text" size="50" name="quote" /><br />
</form>
</body>
</html>
Comment