图像作为按钮问题:( [英] Image As Button Problem :(
问题描述
您好,
我在联系页面上有一个表单,并且要进行布局
跨浏览器/ -platform我要使用作为按钮的图像
而不是使用图像作为按钮上的背景....
问题:当我插入(例如)重置时 - 按钮,并更改来源
type =" button"键入=" image",而不是重置表单,它
提交表单....
任何线索?
谢谢......
Frizzle
> ;问题:当我插入(例如)重置按钮,并更改源type =" button"键入=" image",而不是重置表单,它提交表单....
A type =" image" - 输入总是充当提交。
你可以将javascript onclick放到图片上。
例如
< image src = "图像/ foo.jpg" onclick =" document.frm1.reset();">
最好的问候
deniz adrian
您可以通过javascript提交表单。 sthg like< img
src =" button.gif"
onClick =" javascript :document.forms [''formName' '] .submit();">
>你可以通过javascript提交表格。 sthg like< imgsrc =" button.gif"
onClick =" javascript :document.forms [''formName'']。submit ();">
据我所知,提交不是问题,而是重置:)
Hi there,
I have a form on a contact page, and to make the layout
cross-browser/-platform i want to use an image as a button
instead of using an image as background on a button....
Problem: When i insert a (e.g.) reset-button, and change the source
type="button" to type="image", instead of resetting the form, it
submits the form....
Any clues?
Thanks...
Frizzle
> Problem: When i insert a (e.g.) reset-button, and change the sourcetype="button" to type="image", instead of resetting the form, it
submits the form....
A type="image"-input always acts as a submit.
You can put javascript onclick to the picture.
e.g.
<image src="images/foo.jpg" onclick="document.frm1.reset();">
best regards
deniz adrian
you can submit the form thru javascript. sthg like <img
src="button.gif"
onClick="javascript:document.forms[''formName''].submit();">
> you can submit the form thru javascript. sthg like <imgsrc="button.gif"
onClick="javascript:document.forms[''formName''].submit();">
as i understood, submitting isn''t the problem, but resetting :)
这篇关于图像作为按钮问题:(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!