This first suggestion is why in the heck you need XHTML. Are you outputting anything that requires XHTML features? If the answer is "no, it's straight HTML in an XHTML doctype" drop to 4.01 strict or HTML5. This is a better representation of your document anyway.
But to answer the question, named elements are only valid for form input elements (i.e., anything that needs a named attribute to be posted.) So the form name needs to be form id="...." (and you will need to change any Javascript looking for document.forms['formname'] to document.getElementById('formid'));
XHTML does **not** allow empty elements. Period. Each form element requires some kind of container.
<form...>
<div><input type="hidden" name="somename" value="somevalue"/></div>
<p><label for="email">Email:</label> <input type="text" name="email" id="email"/></p>
</form>
You'll also find target is not a supported attribute in XHTML strict, most people need to use it (the workaround is scripted new windows, this now makes those targets javascript dependent . . . )
I would drop the XHTML, life will be easier if you use an appropriate doctype (and by appropriate I mean if it's HTML, tell the client it's HTML. :-) ) XHTML doctypes have their application but most of the time are not needed.
The way to "fix" your inline Javascript would be to remove it from the source entirely and put it in an external JS (preferably an external file. ) Something like this (NOT working code, typed on the fly . . .)
<input type="button"
id="choose_style" value="Go!" />
</form>
<script type="text/javascript">
window.onload=function() { assignBehaviors(); }
//
function.assignBehaviors() {
if (document.getElementById('choose_style')) {
document.getElementById('choose_style') onclick=function() { get_location(); return false; }
}
}
//
function get_location() {
var loc = document.choseColor.xfer.options[document.choseColor.xfer.selectedIndex].value;
window.location=loc;
}
function Back() {
window.history.back();
}
</script>
[edited by: rocknbil at 5:35 pm (utc) on May 9, 2011]