<script type="text/javascript">
    function toggle(sId,sRc){
        var objId = document.getElementById(sId);
        //document.getElementById(sId).src = sRc;
       objId.src = sRc;
    }
</script>

<img id="siimage" alt="Security Image" src="http://localhost/dev/template_eng/common/plugins/simg/simg.php" /><br />
<input name="securityImageValue" type="text" size="15" />
<a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" onclick="toggle('siimage','http://localhost/dev/template_eng/common/plugins/simg/simg.php');">
<img src='http://localhost/dev/template_eng/common/images/icons/refresh.gif' alt="Reload Image" border="0" onclick="this.blur()" align="bottom" />
</a>


All the above code is suppose to do is rotate a security image i.e. captcha I think it's called.
If the user can't read the security image it should just load a new one but I have tried dozens of different types but can not find a solution that works for both
Internet Explorer and Firefox.

So, does anyone know how to rotate a captcha image across all browsers?

Thanks for any help

    
                                                <img id="siimage" name="siimage" alt="Security Image" src="http://localhost/dev/template_eng/common/plugins/simg/simg.php" /><br />
                                                <input name="securityImageValue" type="text" size="15" />
                                                <a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = 'http://localhost/dev/template_eng/common/plugins/simg/simg.php?sid=' + Math.random(); return false">
                                                    <img src='http://localhost/dev/template_eng/common/images/icons/refresh.gif' alt="Reload Image" border="0" onclick="this.blur()" align="bottom" />
                                                </a>
    
    

    There is yet another problem with Internet Explorer not following standards 🙂

    for JS onclick mozella /wc3 state that it will not reload an event if the previous event is exactly the same so no state change should occur adding the ?sid=Math.random() to the end gives a new event different than the previous event loaded into src element.

    However, microsoft will just go in an infinite loop and does not check to see if there is any differences...lol

      Write a Reply...