shyne
09-05-2007, 09:03 PM
Hi
I am using a form which send users to different url when you select an option. Below is my form and the javascript used.
<form name="Iccy" action="">
Sort By: <select name="blah" class="small">
<option value="http://www.mysite.com/jjskkhkjsl.html">Page1</option>
<option value="http://www.mysite.com/blah.html">Page 2</option>
</select>
<script language="javascript">
<!--
function go() {
location=document.Iccy.blah.
options[document.Iccy.blah.selectedIndex].value
}
//-->
</script>
<input type="button" name="test" value="Go!" onClick="go()">
</form>
Now the problem is that when I validate my page using the w3.org it shows error stating that the onClick="go()" used is invalid and cannot be used with the doc type. I do not want to change my doctype or anything else and I want my page to validate since all my pages are validated nicely.
Can someone please give me another alternative to my approach. Any other way of sending user to that url but within a form and also be validate with XHTML1.0
Thanks
I am using a form which send users to different url when you select an option. Below is my form and the javascript used.
<form name="Iccy" action="">
Sort By: <select name="blah" class="small">
<option value="http://www.mysite.com/jjskkhkjsl.html">Page1</option>
<option value="http://www.mysite.com/blah.html">Page 2</option>
</select>
<script language="javascript">
<!--
function go() {
location=document.Iccy.blah.
options[document.Iccy.blah.selectedIndex].value
}
//-->
</script>
<input type="button" name="test" value="Go!" onClick="go()">
</form>
Now the problem is that when I validate my page using the w3.org it shows error stating that the onClick="go()" used is invalid and cannot be used with the doc type. I do not want to change my doctype or anything else and I want my page to validate since all my pages are validated nicely.
Can someone please give me another alternative to my approach. Any other way of sending user to that url but within a form and also be validate with XHTML1.0
Thanks