473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Javascript works in Firefox but not in IE

Can someone PLEASE show me how to rectify this code so that it works in IE.

Many thanks in advance.


<script type="text/javascript" >
function populate(inForm)
{
var temp=0;
var today= new Date();
var day= today.getDate();
var month= today.getMonth();
var year= today.getFullYear();

t2= 50;
for (var i=0; i <31 ; i++)
{
var x= String(i+1);

inForm.day.options[i] = new Option(x,x);
}

for (var i=0; i <31 ; i++)
{
var d=0;
d=inForm.day.options[i].value;
if(d==day){
inForm.day.options[i].selected=true;
break;}
}

for (var i=0,j=year; i <t2 ; i++, j--)
{
var y= String(j);
inForm.year.options[i] = new Option(y,y);

}
for(var i=0;i<12;i++)
{

if(i=month)
{inForm.month.options[i].selected=true;
break;}

}

}

function populate2(inForm2)
{
var t3=0;


if(inForm2.month.options[1].selected)

t3=28;
else if(inForm2.month.options[8].selected||inForm2.month.options[3].selected||inForm2.month.options[5].selected||inForm2.month.options[10].selected)
t3=30;
else
t3=31;


for(i=0;i<31;i++){
inForm2.day.options[i]=null;
}

for (var i=0; i <t3 ; i++)
{
var x= String(i+1);
inForm2.day.options[i] = new Option(x);

}
}
</script>

<style type="text/css">
<!--
.style1 {
color: #000099;
font-weight: bold;
}
.style2 {color: #FF0000}
-->
</style>

</HEAD>

<BODY onLoad=populate(form1)>

<div align="center" class="style1">
<div align="center">NAC Member Number Search</div>
</div>
<br>
<div align="left">Select your Date of Birth below and enter your First Name and Last Name to search for your NAC Member No.</div>
<form name='form1' action='process_form.php' method='POST'>
<table class='table_form_1' id='table_form_1' cellspacing='0'>
<tr>
<p>
<b>Year</b><SELECT NAME="year"></SELECT>

<b>Month</b> <SELECT NAME="month" onChange = populate2(form1)>
<Option value=1>01</Option>
<Option value=2>02</Option>
<Option value=3>03</Option>
<Option value=4>04</Option>
<Option value=5>05</Option>
<Option value=6>06</Option>
<Option value=7>07</Option>
<Option value=8>08</Option>
<Option value=9>09</Option>
<Option value=10>10</Option>
<Option value=11>11</Option>
<Option value=12>12</Option>
</SELECT>

<b>Day</b> <SELECT NAME="day"></SELECT>

</FORM>

</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='firstName' ACCESSKEY='none' ><b style='color:red'>*</b>First Name
</td>
<td class='ftbl_row_2a' ><input type='text' name='firstName' id='firstName' size='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='lastName' ACCESSKEY='none' ><b style='color:red'>*</b>Last Name
</td>
<td class='ftbl_row_1a' ><input type='text' name='lastName' id='lastName' size='45' value=''>
</td>
</tr>
<tr>
<td colspan='2' align='right'><input type='submit' name='submit' value='Submit'>&nbsp;<input type='reset' name='reset' value='Reset'><br /><a</a>
</td>
</tr>
</table>
</form>
Jul 14 '07 #1
1 1195
acoder
16,027 Expert Mod 8TB
So what happens in IE? Do you get any error messages?
Jul 16 '07 #2

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

Similar topics

12
by: Howard Kaikow | last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is either a bug in Firefox or a bug in my Javascript code. I'll try to explain the problem, hoping that this newsgroup can...
5
by: LRW | last post by:
(Sorry if this is a repost...my newsreader keeps crashing on the posting--I don't know if the message going out or not) For some reason this javascript just won't work in Firefox. It works fine...
6
by: Cliff R. | last post by:
Hi, I use a handy little Javascript Flash detection script on a number of sites (copied below). Usually works great, but I just started trying Firefox and it's not working. A few browsers are...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
2
by: John | last post by:
I've been working on making my ASP.NET web apps compatible with Firefox (the uplevel configs for web.config are a real help). However, one really weird thing is a GotoAnchor() function I have...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
11
by: minnesotti | last post by:
Hi there, I subscribed to a photographic pictures-hosting website which is heavy on JavaScript. My preferred latest browser Mozilla Firefox does not work with it -- no pictures are displayed and...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
6
by: davidiwharper | last post by:
Hi there. I'm putting together a page to collect some information from our website users and send the administrator an email. To this end I have some Javascript form validation in an external...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.