When writing JavaScript that refers to other elements on the page you should make it last thing on the page, otherwise the items that it refers to will not yet be known by the browser.
With regards just using:
Code:
document.myForm.quote.value = quote;
...that's fine if your script has previously stored the quote in a variable called quote. My example used function call that returns the quote instead - the result is the same.
The following code should work - it will set a quote into the variable quote; set the hidden form field, and then display the value of the hidden form field in an alert box so you can see the contents...
Code:
<html>
<body>
<form name='myForm'>
<input type='hidden' name='quote' id='quote' value='' />
</form>
<script type='text/javascript'>
quote = 'This is the quote of the day!';
document.myForm.quote.value = quote;
alert(document.myForm.quote.value);
</script>
</body>
</html>
Hope this helps!
Bookmarks