Javascripts > Javascript Forms > Random Quote in Form Box
Script Title: Random Quote in Form Box
Description: Get a random quote an insert it into a form box.
Example: Available
Copy the following code between the <BODY></BODY> tags of your html page.<form name="random"><input type="text" name="random" size=75 value=""></form> <SCRIPT LANGUAGE="JavaScript"> function getQuote() { // create array of quotes var ar = new Array(20) ar[0] = "A man who carries a cat by the tail learns something he can learn in no other way." ar[1] = "All that I know I learned after I was thirty." ar[2] = "Every moment is an experience." ar[3] = "Excellence is not a skill. It is an attitude." ar[4] = "Experience is a great teacher." ar[5] = "Experience is one thing you can't get for nothing." var now = new Date() var sec = now.getSeconds() document.random.random.value="Murphy's Law: " + ar[sec % 5] } getQuote() //--> </SCRIPT>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email