File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 agree. Here's the link:
subject: Problem with html image tag inside input tag
Similar Threads
Disable and Enable a Submit Button
Buttons in same form hitting different servlets
ImageButton with DispatchAction
assign values to form elements dynamically?
How to hide image path in JSP