Forum Moderators: open

Message Too Old, No Replies

Problem with script not working in firefox. Works fine in IE

         

outdoorxtreme1

5:45 pm on May 21, 2010 (gmt 0)

10+ Year Member



Can someone tell me what I need to change to get this code to run correctly in Firefox. It works fine in IE. These are just the code segments that I am having issues with. Thanks in advance.

<script>
function callFullscreen() {
var saddr=document.getElementById('saddr').value;
var daddr=document.getElementById('daddr').value;
fullScreen('http://maps.google.com/maps?saddr='+saddr+'&daddr='+daddr+'&t=m')
}
</script>

echo '<form name=\"addr_form\" id=\"addr_form\" onSubmit=\"callFullscreen(); return false;\">
<div align=\"left\"><br><b>Get Directions</b><br><font size=2>Your address: (street, town, state)</font>
<br><input type=\"text\" size=40 maxlength=40 name=\"saddr\" id=\"saddr\" value=\"\" />
<input class=\"button\" type=\"submit\" onClick=\"callFullscreen(); return false;\" value=\"Go\">
<input type=\"hidden\" name=\"daddr\" value=\"',$row['lat'], ", " , $row['lon'],'\"/></div></form>';

Fotiman

5:50 pm on May 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You are missing an id of 'daddr' on your hidden item. IE has a bug where document.getElementById will match named items as well, which is why it still works in IE. Give that last item an id and that will probably fix it.