Jump to content

onChange works with IE but not Firefox


ded

Recommended Posts

Hello All,

 

The following code works perfectly fine with IE, but does nothing when using Firefox.  Any suggestions?

 

<script type="text/javascript">
<!--
function personHandler(form){
var URL = "http://www.website.com/rollcall/index.php?rrn="+rollcall.rrn.value;
window.location.href = URL;
}
//-->
</SCRIPT>

 

<?php
$dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("database"); 

$query = "SELECT * FROM `rollcall` ORDER BY `lname`";
$result = mysql_query($query,$dbh) or die(mysql_error());

if (result){
		 echo "<br /><br /><center><form name=\"rollcall\">";
	     echo "<select name=\"rrn\" size=1 onChange=\"javascript:personHandler()\">";
   			 echo "<option value=''>Select Individual</option>";		

while($row = mysql_fetch_array($result))
		  	{
   			 echo "<option value='{$row['rrn']}'>{$row['lname']}, {$row['fname']}</option>";		
			} 
	     echo "</select></form></center>";
		}
?>

 

Regards,

DED

Link to comment
https://forums.phpfreaks.com/topic/116596-onchange-works-with-ie-but-not-firefox/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.