im working on a javascript project at the moment and im having a few problems.
for some reason the page never seems to full load (from what i guess meaning a neverending loop) which i cant find.
also on the loops containing DIRECTOR i never get any results which i cant understand atall when the exact same script works on the FILM_YEAR and gives results.
thanks in advance
[CODE]
// global variables to freely use
var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
var results;
var FILM = new Array();
var FILMA = new Array();
var FILMB = new Array();
var FILMD = new Array();
//loop the list of directors
function director()
{
for (i=0;i<DIRECTOR.length;i++)
{
document.write(“<option value=”+DIRECTOR[i]+”>” + DIRECTOR[i] + “</option>”);
}
}
//loop the list of film dates
function filmdate()
{
for (i=0;i<FILM_YEAR.length;i++)
{
document.write(“<option value=”+FILM_YEAR[i]+”>” + FILM_YEAR[i] + “</option>”);
}
}
//function to check if the year matches the entered data
function checkvalues()
{
formdirector=document.filmsear.formdirector.value;
formyear=document.filmsear.formyear.value;
n = 0;
document.write(“<h1>Matching Films For Year:</h1>”);
//loop through the years and check if any results match if they do
//assign DIRECTOR[i] TO FILMD[i] so only the valid years are stored in the array
for (i=0;i<FILM_YEAR.length;i++)
{
if (FILM_YEAR[i] == formyear)
{
FILMD[i] = DIRECTOR[i];
FILMA[n] = FILM_YEAR[i] + ” | ” + FILM_TITLE[i] + ” | ” + DIRECTOR[i];
document.write(“<p>” + FILMA[n] + “</p>”);
n = n++;
}
}
n = 0;
document.write(“<h1>Matching Films For Director:</h1>”);
//loop through the directors and check if any results match.
for (i=0;i<DIRECTOR.length;i++)
{
if (DIRECTOR[i]==formdirector)
{
FILMB[n] = FILM_YEAR[i] + ” | ” + FILM_TITLE[i] + ” | ” + DIRECTOR[i];
document.write(“<p>” + FILMB[n] + “</p>”);
n = n++;
}
}
n = 0;
document.write(“<h1>Matching Films For Year and Director:</h1>”);
//loops through the new array of the matching years and checks if they match the directors name then write the results
for (i=0;i<FILMD.length;i++)
{
if (FILMD[i] == formdirector)
{
FILM[n] = FILM_YEAR[i] + ” | ” + FILM_TITLE[i] + ” | ” + DIRECTOR[i];
document.write(“<p>” + FILM[n] + “</p>”);
n = n++;
}
}
}