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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    152
    Thanks
    8
    Thanked 0 Times in 0 Posts

    why type="image" can't work under IE?

    Code:
     $html .= '<div id="submit"><input type="image" name="subscribe" onmouseover="this.src=\'images/1_hv.jpg\'" onmouseout="this.src=\'images/1.jpg\'" src="images/1.jpg"  value="'.$data["button"].'" onClick="return checkform();"></div> ';
    why the type="image" code can't work under IE? when i click the image under IE, it can't work. it can't submit the form. but under firefox and chrome.it can work. how to correct it ?
    when i change the input into
    Code:
    <input type="submit" name="subscribe" value="'.$data["button"].'" onClick="return checkform();">
    when under IE,firefox,chrome. all can work

  • #2
    Regular Coder
    Join Date
    May 2009
    Posts
    425
    Thanks
    3
    Thanked 62 Times in 61 Posts
    You could try just adding a CSS style to the type="submit" since you know it works; i.e.,
    PHP Code:
    <input type="submit" style="background:url('/someimage.png');width:160px;height:20px;border:1px solid #000000;" name="subscribe" value="'.$data["button"].'" onClick="return checkform();"
    Other than that, I can't be of much help without the rest of your code.

  • #3
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    yeah use css to style buttons.

    quick example.

    Code:
    <input type="submit" id="mybutton".........
    
    #mybutton {
    background:url(image.jpg).......
    }
    
    #mybutton:hover {
    background:url(hoverimage.jpg).......
    }

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,633 Times in 4,595 Posts
    I use <input type=image> all the time with MSIE. I have no idea why you say it doesn't work.

    I did notice that you were trying to give a value= to an <input type=image>, and that will never work. But other than that...

    Possibly you have a bug in your checkForm() code?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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