3

I have two image-type buttons on my page:

<input type="image" src="logg.png" name="saveForm" class="btTxt submit" id="saveForm" />
<input type="image" src="logg.png" name="saveForm1" class="btTxt submit" id="saveForm1" />

The problem is that the buttons' image doesn't load up. When I get rid of one of the buttons, though, everything is fine. The buttons have different names and IDs, what's the problem?

user132181
  • 141
  • 4

2 Answers2

1

You're missing the ALT values. These are needed incase the image can't be loaded: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input

Here's an alternative approach:

Create two <buttons> or <input type="submit"> and style their backgrounds using css.

If your goal is to submit the png image in the form, there's a similar answer here: <button> background image

Community
  • 1
  • 1
Giwan
  • 1,564
  • 14
  • 17
0

Check if the image source location is valid and the image is available in the location where the browser is searching for. Check that by right clicking on the image button, use option Inspect element(available only in higher versions of browsers) and check for the source location for the image.

In ur case the image should be available on the same folder where the html is available.

Check for typo errors.

MANOJ GOPI
  • 1,279
  • 10
  • 31