Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 118,588 Programmers for FREE! Ask your question and get quick answers from experts. There are 821 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Arrays

 
Reply to this topicStart new topic

Arrays

velaphi
post 23 Jul, 2008 - 12:42 PM
Post #1


New D.I.C Head

*
Joined: 20 Jul, 2008
Posts: 8

Hi, there is something missing in this code.

<html>
<head>

<title>Random Proverbs</title>

<script LANGUAGE="text/javascript">
<!--Hide from the old browser

function changeQuote() {
quotes = new Array;
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. ";
var newQuate= quotes[Math.round(Math.random()+quotes.length)];
<document.quoteform.qoute.value=newQuate;>
}
var tick = setInterval("changeQuote()")
</script>
</head>
<body>
<form action=" ">

<input type="text" size="50" name="quote"><br><br>

</form>
</body>
</html>[code]
User is offlineProfile CardPM

Go to the top of the page


ahmad_511
post 23 Jul, 2008 - 03:18 PM
Post #2


D.I.C Regular

Group Icon
Joined: 28 Apr, 2007
Posts: 351



Thanked 8 times

Dream Kudos: 400
My Contributions


Hello,
there are many things that needto fix but it's toosimple
take a look at this
jscript

<html>
<title>Random Proverbs</title>
<head>
<script type="text/javascript">


function changeQuote() {
quotes = new Array();
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. ";
var newQuate= quotes[Math.round(Math.random()*quotes.length)];
document.getElementById("quote").value=newQuate;
}
var tick = setInterval("changeQuote()",1000)
</script>
</head>
<body >
<form id="quoteform" action=" ">

<input type="text" size="50" id="quote"><br><br>

</form>
</body>
</html>

I hope it helps

This post has been edited by ahmad_511: 23 Jul, 2008 - 03:19 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/11/08 07:32PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month