jQuery in Action, 2nd edition*
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
Author

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 button..so after doing the on click funtion it is submitting the form which i dont want to...

Please suggest any other way...
Ben Souther
Sheriff

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
 
 
subject: Problem with html image tag inside input tag
 
Similar Threads
Disable and Enable a Submit Button
ImageButton with DispatchAction
Buttons in same form hitting different servlets
How to hide image path in JSP
assign values to form elements dynamically?