JS works in all but Firefox for Mac...done lots of homework...
hey everyone...I know this has been brought up on the web before (I've been researching all morning to try to find an answer) but I can't quite get it right in my particular case. I'm a designer and not a coder, and the code that I'm working with was done by someone else...I've just been given the task of fixing the problem.
the link is here >> http://www.medrec-pt.com/search/index.html, but you have to click through the first 3 sets of questions to get to where I'm having trouble. you'll come to a map that says to choose the states you're interested in. when you click on a state, it adds it to the list on the left. this seems to work fine in all browsers, both windows and mac, except for firefox on a mac. looking at the JS error console, I see it says
Quote:
Error: form_3 is not defined
Source File: javascript:addMapState(form_3.mystates,%20form_3,% 20'NEVADA')
Line: 1
I've gone into both the HTML file an the JS file to see what I could find. the only thing I could find that seemed suspisious to me (and being a designer, I really didn't know where to start, I just started digging around...) is in the JS file, all the other forms were called before their functions. for example:
HTML Code:
function process_screen_2() {
var answer = '';
var position = '';
var form = document.getElementById('form_2');
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].checked) {
answer = form.elements[i].value + ' ';
position = form.elements[i].value;
}
}
var error = '';
if (answer == '') {
error = "Please select the type of position you are interested in.<br />";
}
if (error == '') {
document.getElementById('screen_3_blank_1').innerHTML = answer;
document.getElementById('screen_4_blank_1').innerHTML = answer;
document.getElementById('screen_2').style.display = "none";
document.getElementById('screen_3').style.display = "block";
document.getElementById('position_answer').value = position;
} else {
document.getElementById('error_2').innerHTML = error;
}
return '';
}
however, I noticed that the next one (the form_3 that I was having errors with) did not have the line
HTML Code:
var form = document.getElementById('form_3');
so I added it, thinking that would solve the problem. but nothing changed. any suggestions? here's the code that I changed in the JS file:
HTML Code:
function process_screen_3() {
var answer = '';
var city_input = '<table>';
var form = document.getElementById('form_3');
var states = document.getElementById('mystates');
var count = 0;
for (var i = 0; i < states.options.length; i++) {
if (count > 0) {
answer += ', ';
}
var state = capitalize(states.options[i].value);
answer += state;
city_input += '<tr><td>' + state;
city_input += '<input type="hidden" name="STATE_' + i + '"';
city_input += ' id="STATE_' + i +'" value="' + state + '" />' + '</td>';
city_input += '<td><input name="' + i + '" type="text" size="40" /></td></tr>';
count++;
}
city_input += '</table>';
if (count > 1) {
answer = replace_last_comma(answer);
}
var error = '';
if (count == 0) {
error = "Please select where you want to work.<br />";
}
if (error == '') {
document.getElementById('screen_3b_blank_1').innerHTML = city_input;
document.getElementById('screen_3').style.display = "none";
document.getElementById('screen_3b').style.display = "block";
} else {
document.getElementById('error_3').innerHTML = error;
}
return '';
}
"Click for next page" doesn't work from the first page of that link - I can't get to the page your on about.
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
For the image map href tags. It then works in FF too.
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Dont forget to mark as SOLVED (top of this topic in thread tools menu)
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish