Ok, I've been struggling with this for the last 2 days. I've finally narrowed down my problem and was able to create a simple HTML page to illustrate this.
Can anybody tell me why the following code works in IE (all versions) and not in Firefox, Safari, etc?
<HTML>
<BODY>
<INPUT type='hidden' id='year_key' name='year_key' value='2005'>
<a href="#" class="" id="tab6">
<select id="sel_year" name="sel_year" size="1" onchange='select_year();'>
<option value="2013">2013
<option value="2012">2012
<option value="2011">2011
<option value="2010">2010
<option value="2009">2009
<option value="2008">2008
<option value="2007">2007
<option value="2006">2006
<option selected value="2005">2005
<option value="2004">2004
<option value="2003">2003
<option value="2002">2002
<option value="2001">2001
<option value="2000">2000
</select>
</a>
</BODY>
</HTML>
<SCRIPT language='javascript'>
function select_year() {
alert("select year");
document.getElementById("year_key").value = document.getElementById("sel_year").value;
}
</SCRIPT>
Can anybody tell me why the following code works in IE (all versions) and not in Firefox, Safari, etc?
<HTML>
<BODY>
<INPUT type='hidden' id='year_key' name='year_key' value='2005'>
<a href="#" class="" id="tab6">
<select id="sel_year" name="sel_year" size="1" onchange='select_year();'>
<option value="2013">2013
<option value="2012">2012
<option value="2011">2011
<option value="2010">2010
<option value="2009">2009
<option value="2008">2008
<option value="2007">2007
<option value="2006">2006
<option selected value="2005">2005
<option value="2004">2004
<option value="2003">2003
<option value="2002">2002
<option value="2001">2001
<option value="2000">2000
</select>
</a>
</BODY>
</HTML>
<SCRIPT language='javascript'>
function select_year() {
alert("select year");
document.getElementById("year_key").value = document.getElementById("sel_year").value;
}
</SCRIPT>