Gossamer Forum
Home : Products : Links 2.0 : Customization :

change image function in form

Quote Reply
change image function in form
Ieps,

I have a little problem with the two submit possibilities of a form. I've created a form with an ordinary submit button

<input type="submit" value="save">

The form contains also images. Therefore I use

<input type="image" src="image.gif" onclick="doCal('this.fom.number')"> because the result of the doCal function must be visible in the formfield form.number. There is only one problem...The function shows the result correctly in the formfield but because I use an image-type the form will also submitted. But that is not allowed because I have an other submit button.

Is there a way to get rid of the submit function when I use <input type=image>?

I've already tried to use the <a href> but that has the problem that it doesn't save the functionresult in the formfield. In the meantime I use the following solution

<button name="knop" onclick="DoCal(this.form.number)" >
<img src="image.gif">
</button>

a solution I am not happy with because the image doesn't fill the button completely up.

So I wan't to get rid of the automatic sumbit of the image input field. Does anyone have an idea??

Thx