Javascript Form submission: undefined
<p>This must be a simple problem but i can't figure out why it's not working. The script shall pass values of the <code>tags</code> field to a script on the same page.</p>

<pre><code>&lt;FORM id="form" METHOD="" ACTION="#" &gt;
&lt;input size="40" name='tags' id='tags' onSubmit="javascript: submitForm(this)"&gt;
&lt;INPUT TYPE="submit" id='q' VALUE="Submit" &gt;
&lt;INPUT TYPE="reset" VALUE="Reset"&gt;
&lt;/FORM&gt;
&lt;div id='info'&gt;This sentence will be replaced&lt;/div&gt;

&lt;script&gt;

var tags;

function submitForm(form)
{
    tags = form.tags.value
    return false ;
}
alert(tags)
...
&lt;/script&gt;
</code></pre>

<p>alert box says: <code>undefined</code></p>
