Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    262
    Thanks
    23
    Thanked 1 Time in 1 Post

    Post Working in FF but not IE......

    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 :

    PHP Code:

    <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 !

  • #2
    New Coder sdcomputerz's Avatar
    Join Date
    Feb 2007
    Location
    Hawaii
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think this is more a JavaScript problem then PHP.
    You can never have nothing, because nothing is still something.
    SD Computerz
    Free Domain Names
    Gaming Lagoon - Buying your game time!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •