Hi all, I know that there was a post about this already, but it was back in 2005. Just wondering you could you help me out.

I've a simple piece of code that users will enter a promotional code and they then will be brought to a registration page once they've submitted the code.
However the issue that I'm find is that when I click submit it goes straight to the page even though there is a restriction applied to the input text.

the code:

<form action="demo_form.asp">
Code: <input type="text" name="code" required="required" />
<input type="submit" value="submit" onclick="window.location='http://www.#.com'">
</form>

How can I set it that the onclick will look to see if the promotional code has been entered?

Thanks in advance.
C