469,315 Members | 1,589 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

problem with IE7 while doing html+javascript

Hello guys i have doubt regarding javascript,here i am embedding javascript code in to html code,i tried this code this is working fine on Netscape and Firefox but it is not working on IE7 can u any body please rectify this problem please......

[HTML] <html> <head>
<title>Minimal Input</title>
<script type="text/javascript">
function changedays(x) {
var y=x;
var variable1=document.getElementById("3");
var variable2=document.getElementById("4");
if(y == "February"){
variable1.style.display="block";
variable2.style.display="block";
}
else{
variable1.style.display="none";
variable2.style.display="none";
}
}
</script>
</head>
<body bgcolor="lightgreen">
<p style="font-family:verdana;font-size:75%;color:red">
<center>
<p style="font-family:verdana;font-size:250%;color:red">
<b>Day/Weekly Activity Report</b>
</p>
<TABLE BORDER=0 cellspacing=20>
<center>
<b>Month:</b>
<select name="month" id="res" onchange="changedays(this.options[this.selectedIndex].value)">
<option value="january">January</option>
<option value="February">February</option>
<option value="March">March</option>
</select>
<b>Date:</b>
<select name ="fromdate" id="rest" >
<option id="1">1</option>
<option id="2">2</option>
<option id="3">3</option>
<option id="4">4</option>
</select>
<input type="submit" value="Submit">
</TABLE>
</body>
</html> [/HTML]

Thanks in advance.
May 7 '07 #1
1 1224
acoder
16,027 Expert Mod 8TB
Welcome to TSDN.

To change select options, you need to add/remove them properly.

See this link.
May 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Shlomi Schwartz | last post: by
2 posts views Thread by Abraham Andres Luna | last post: by
9 posts views Thread by outstretchedarm | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.