Results 1 to 5 of 5

Thread: Replace type="image" over type="submit"

  1. #1
    Join Date
    Jul 2011
    Posts
    36
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Replace type="image" over type="submit"

    Hi,

    I tried to replace my submit button by replacing type="image" over "submit" and the form doesn't work properly. Is there something Im missing out? If i wanted to replace my submit button with an image is there a special way to do it for forms?? Any help is appreciated thanks. below is the code btw

    <input type="image" name="signin" value="Login" src="/images/login_button.gif">

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Works fine here:

    Code:
    <form action="#">
    <input type="text" name="bob" value="Sid">
    <input type="image" name="signin" value="Login" src="soft-enamel.gif">
    </form>
    If you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2011
    Posts
    36
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi my code looks like this

    <input type="hidden" name="username" value="<?=$_SESSION['member']?>" /><br>
    <input type="image" name="Submit" value="Add New Album" src="/images/addalbum.gif" border="0" />

    is there any reason why from the code above making it not work properly?? I have a feel the whole script itself is causing it to malfunction because my site is a members based site and there are other functions involved. I was just wondering if by any chance maybe I messed up the two lines above. Thanks.




    Quote Originally Posted by jscheuer1 View Post
    Works fine here:

    Code:
    <form action="#">
    <input type="text" name="bob" value="Sid">
    <input type="image" name="signin" value="Login" src="soft-enamel.gif">
    </form>
    If you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's not a form. If it's part of a form, it could be OK, but there could be many other factors. But this works:

    Code:
    <form action="#">
    <input type="hidden" name="bob" value="Sid">
    <input type="image" name="signin" value="Login" src="soft-enamel.gif">
    </form>
    I can't diagnose it further from just those two lines.

    As I said before, if you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.


    If it's members only, give me a guest membership. You can PM me the name and password.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2010
    Location
    Minnesota
    Posts
    256
    Thanks
    1
    Thanked 21 Times in 21 Posts

    Default

    Did the form work before you changed the input to a image? If it did, is it not working in IE but works in firefox and others? IE doesn't look at a submit button the same if it's a image. Are you checking if it was submitted with something like this -
    PHP Code:
    if(isset($_POST['submit'])) 
    If yes, try this
    PHP Code:
    if(isset($_POST['submit']) || isset($_POST['submit_x'])) 
    I have had to use this before for stupid IE. IE wants to read the image with coordinates cause it sees the image.

Bookmarks

Posting Permissions

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