3

What are the advantage and disadvantage of using both?

  1. CSS

    <input type="submit" class="removeBtn" /> .removeBtn{ background: url(Images/Remove.png); height: 25px; width: 25px; } 
  2. Inline

    <input type="image" src="Content/Images/Remove.png" /> 
6
  • Could someone fix the code for me? I cant seem to get it to show up in code blocks. Commented Apr 5, 2011 at 11:44
  • 1
    @Lol coder: Done. Code blocks within lists are a pain - you need to indent twice, so 8 spaces per line :) Commented Apr 5, 2011 at 11:46
  • Also consider <button><!-- MORE HTML!--></button> ? Commented Apr 5, 2011 at 11:49
  • @JohnP: More specifically, <button type="submit">. Commented Apr 5, 2011 at 11:51
  • 1
    @JohnP: I am one of the privileged few! :) Commented Apr 5, 2011 at 11:55

1 Answer 1

8

Semantically speaking, you should always use a submit button. A user with a screenreader will have no idea what the function of your image input is.

Edit: as per comments, the image button will automatically submit a form as well as an input with type="submit"

Sign up to request clarification or add additional context in comments.

2 Comments

<input type="image"> functions as a submit button too. But good point about accessibility, unless the image input's alt attribute mentions its submit functionality.
@BoltClock is exactly right, if you use it correctly, there is no problem with input type="image". If you put this info into your answer, I will be ready to upvote.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.