is there anyway for me to do this

<select name="dates" id="dates" onchange="JavaScript:setoption()">
when i use the validator of http://validator.w3.org

that will be err as following:
an attribute value must be a literal unless it contains only name characters.
onchange=JavaScript:setoption() name=dates>