input type="image" ??
when using the input type image like so...
<input type="image" value="url" name="url" alt="url" src="../../images/admin/url.gif">
is it only possible to use it with submit, ie can it be made to do other button functions like reset or none (for a customised button)??
thanks in advance
Sure you can. Just put an onclick event on the input type="image" like this example (it will reset your form):
but be aware: it will also do a submit if you defined an action in the form tag. So you will have to add your own submit code to another button.
>Lbut be aware: it will also do a submit if you >defined an action in the form tag. So you will have >to add your own submit code to another button.
thats what i was thinking, the other annoying thing is that its writes submit to the status bar even when its not going to be a submit and there seems to be no way to stop this from happening.
But if you want to use an image as a button, don't use the input type="image". Just make a <img> a put an onclick event on that image. Then you can do anything you want (submit, reset, form validation or whatever...)
good idea, did'nt think of that!! thats what i'll do as it will fix both problems for me.