Javascript & Firefox

The Donut

2[H]4U
Joined
Jan 28, 2003
Messages
3,121
Hey,

I'm just trying to figure out a problem, why this javascript doesn't seem to work in Firefox but works fine in IE. The dropdowns I setup work and function correctly.

Here is the code, after you hit the "Go" button.

<script language=Javascript>function findmyink() {window.location.replace('http://mysite.com/'+brandSelect.value+'/'+modelSelect.value+'.html')};</script>
Now, in IE the script works fine and it goes to the page thats generated using the dropdown values (brandselect and modelselect). However, in Firefox, there are no JS errors, but clicking the Go button does nothing. Link shows up, but nothing shows up.

(I'm using href="javascript: findmyink()")

Anyone have any ideas?
 
Have the variables brandSelect and modelSelect been defined? Or are you tyring to directly access form controls by name?

Try document.getElementById('brandSelect').value or document.formname.brandSelect.value
 
Back
Top