This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Problem with html image tag inside input tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem with html image tag inside input tag" Watch "Problem with html image tag inside input tag" New topic

Problem with html image tag inside input tag

vandu matcha
Ranch Hand

Joined: Dec 28, 2005
Posts: 57
I have a problem displaying image on the button tag

[input type="button" value=" [img src='images/arrow.jsp' ] " on click="function1()" / ]

Its not picking up the image value instead it displays whole tag...instead of processing image tag...

any correct way of defining this so that the img tag is processed....
or any other way of displaying an img on the button..

i know that [input type="image" src="path" ]tag is present but it is by default submit after doing the on click funtion it is submitting the form which i dont want to...

Please suggest any other way...
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

That's not the way to do that.
Either use an <input type="image" tag or put the image in the body of the button tag.
<button ...><image src=.../></button>

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Problem with html image tag inside input tag
It's not a secret anymore!