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 5 of 5
  1. #1
    Xax
    Xax is offline
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with Javascript form input in IE

    This works fine in Firefox, but does nothing in IE. Here's the code:

    <input type="image" scr="http://www.site.com/new/images/contshop.png" onclick = "window.open ('http://www.site.com/index.php', '_self');" />

    <input type="image" src="http://www.site.com/new/images/checkout.png" onclick = "if (ChkOpts ()) document.forms.ppform.submit ();" />

  • #2
    Xax
    Xax is offline
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just wanted to add that neither button works with IE. Do I need to enclose these in a <script> for javascript perhaps?

  • #3
    Xax
    Xax is offline
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've been working on this for several hours, trying to find out why either button won't work in IE with no luck. I'm open to suggestions, please help!

  • #4
    New Coder
    Join Date
    Aug 2006
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post
    <input type="image" scr="http://www.site.com/new/images/contshop.png" onclick = "window.open ('http://www.site.com/index.php', '_self');" />

    <input type="image" src="http://www.site.com/new/images/checkout.png" onclick = "if (ChkOpts ()) document.forms.ppform.submit ();" />

    First, posting in the correct forum could help.

    Second: you could do it this way, though, might make it easier on you if on the first button if you change it to an image tag and you anchor it via the <a> tag
    <a href="http://www.site.com/index.php" target="_self">
    <img scr="http://www.site.com/new/images/contshop.png" />
    </a>

    And, for the other, I'd need to see more code.

  • #5
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After a few headaches, I got this to work:

    <script type="text/javascript">
    function processForm(myform,obj){
    var formId=myform.getAttribute("id");
    var hiddenField = document.createElement("input");
    hiddenField.setAttribute("type", "hidden");
    hiddenField.setAttribute("name", obj.name);
    hiddenField.setAttribute("value", obj.value);
    myform.appendChild(hiddenField);
    }
    </script>

    In the html:

    <form action="{$self}" id="loginForm" method="post">
    <input name="action" id="action" value="login" class="button" type="image" src="{imageUrl}" onclick="processForm(this.form,this)";/>
    </form>

    Works in IE , FF, and Chrome

    Hope this helps someone,

    JJ


  •  

    Posting Permissions

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