...

View Full Version : Working in FF but not IE......



Peuplarchie
06-06-2007, 11:37 PM
Good day,
I have a problem with the form below. The dropdown box work in FF but not in IE, can some one help me.

Here is the error that it give to me ;
document.background is null or not an object
or
document.noimage is null or not an object

and here is the for :




<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="add">
<table border="0" align="center" cellspacing="1" cellpading="0" width=800 valign="top">
<tr><td bgcolor="#663300" align="left" class="black"><b class="white">Cr&eacute;er un nouveau message ....</b></td></tr>
<tr><td bgcolor="#cccc99" width="600" valign="top" rowspan="2"><table border="0" align="left" cellspacing="1" cellpading="0" width=600 valign="top">
<tr><td width="600" valign="top" align="left" class="black">
<center>Titre : <input type="text" name="titre" size="70"></center><br>
Message :<br>
<textarea name="commentaire" rows="10" cols="60"></textarea><br>
<br>

<input type="hidden" name="affiche" value="<?php echo $aujourdhui; ?>">
</td>




<td width="200" valign="top" align="center">
<script language="JavaScript" type="text/javascript" >
function changePic(fe){
var opt_key = fe.selectedIndex;
var fileName = fe.options[opt_key].value;
document.noimage.src=fileName;
return true;
}
</script>
<select name="image" onchange="changePic(this);">
<?php
function PGL_ConfigList($dir)
{
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
if($open = opendir($dir))
{
while(false !== ($file = readdir($open)))
{
if(eregi($pattern, $file) && !is_dir($file))
{
$files[] = $file;
}
}
}
closedir($open);

return($files);
}
$dir = "../upload/";
$list = PGL_ConfigList($dir);
foreach($list AS $file)
{
echo "<option value=\"../upload/$file\">$file</option>";
}
echo "</select>";
?>
<br>
<img src="http://www.voyageurs.peuplies.info/Maude/Equateur_2007/upload/peuplies logo select.jpg" width="100" id="noimage" align="center">


</td>
</tr>






<tr><td width="200" valign="top" align="center">
<script language="JavaScript" type="text/javascript" >
function changePic2(fe){
var opt_key2 = fe.selectedIndex;
var fileName2 = fe.options[opt_key2].value;
document.background.src=fileName2;
return true;
}
</script>
<select name="background" onchange="changePic2(this);">
<?php
function PGL_ConfigList2($dir)
{
$pattern2="\.(jpg|jpeg|png|gif|bmp)$";
$files2 = array();
if($open = opendir($dir))
{
while(false !== ($file = readdir($open)))
{
if(eregi($pattern2, $file) && !is_dir($file))
{
$files2[] = $file;
}
}
}
closedir($open);

return($files2);
}
$dir2 = "../Background/";
$list2 = PGL_ConfigList2($dir2);
foreach($list2 AS $file2)
{
echo "<option value=\"../Background/$file2\">$file2</option>";
}
echo "</select>";


?>
<br>
<img src="http://voyageurs.peuplies.info/Maude/Equateur_2007/upload/peuplies logo select.jpg" width="100" id="background" align="center">


</td>
</tr>






<tr><td valign="top" align="left" class="black" colspan="2">
<center><input type="submit" name="submit" value="Pr&eacute;-visualiser & Confirmer"></center>
</td></tr>
</table>
</table>

</form>





Cansomebody point me my mistake ?

Thanks !

sdcomputerz
06-07-2007, 12:21 AM
I think this is more a JavaScript problem then PHP.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum