在提交按钮上使用图像 [英] using image on submit button

查看:50
本文介绍了在提交按钮上使用图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i想在我的提交按钮上使用图像,但是我遇到了问题,因为它没有执行与之关联的javascript。

For例如,这是我的退出按钮:


< input type =" image"名称= QUOT;出口" SRC ="图像/ exit.jpg"边界=" 0" onClick =" window.close();">


当我点击时,会弹出一个窗口弹出询问确认是否退出,即使我说不,它会回到之前打开的页面。当我使用< input type = image>时我和其他提交按钮有同样的问题


我还有其他方法可以使用< input type = submit>放置图像本身?

请帮忙。

解决方案

您可以尝试使用图像作为提交按钮的背景。它可能与实际的< intput type = image>看起来不一样但它可能会很接近。你描述的问题是关闭窗口或做其他事情的javascript的典型问题,它将控制权交给用户而不是javascript,否则网页可以控制你的网上冲浪,就像弹出后弹出窗口的糟糕过去那样把你带到互联网上你可以大麦防止它发生。



您可以尝试使用图像作为提交的背景按钮。它可能与实际的< intput type = image>看起来不一样但它可能会很接近。你描述的问题是关闭窗口或做其他事情的javascript的典型问题,它将控制权交给用户而不是javascript,否则网页可以控制你的网上冲浪,就像弹出后弹出窗口的糟糕过去那样带你到互联网,你可以大麦防止它发生。





i对此做了大量搜索,我发现< button type = submit>
$可以使用b $ b。


< button type = submit>< img src =" images / go.gif"边界=" 0" alt ="继续下一页 /> < / button>

但是,我在图像周围有一个灰色的盒装边框,我怎么能让它消失。

也,我从哪里调用我的javascript代码?


在你的CSS中:


按钮{

保证金:0;

填充:0;

border:0;

}


不是javscript人但是:

< button type = submit onclick =" alert(''hello'')">< img src =" image.png"边界=" 0" alt ="继续下一页 />

hi,
i want to use an image on my submit button, but im having problems with it, as it does not execute the javascript associated with it.
For example, this is my exit button:

<input type="image" name="exit" src="images/exit.jpg" border="0" onClick="window.close();">

When, i click on in, a window pops-up asking confirmation to exit or not, even if i say no, it goes back to the previously opened page. im having the same problem with other submit buttons when i use <input type=image>

Is there any other way i can put an image using <input type=submit> itself?
Please help.

解决方案

You could try using an image as the background for a submit button. It may not look the same as an actual <intput type=image> but it would probably be close. The problem you described is typical of javascript to close a window or do other things, it leaves control to the user and not the javascript otherwise webpages could take control of your web surfing like the bad old days when pop-up after pop-up would take you all over the internet and you could barley prevent it from happening.


You could try using an image as the background for a submit button. It may not look the same as an actual <intput type=image> but it would probably be close. The problem you described is typical of javascript to close a window or do other things, it leaves control to the user and not the javascript otherwise webpages could take control of your web surfing like the bad old days when pop-up after pop-up would take you all over the internet and you could barley prevent it from happening.


hi,
i did a lot of searching regarding this, and i found that <button type=submit>
can be used.

<button type=submit ><img src="images/go.gif" border="0" alt="Continue to the next page" /> </button>
but,i am getting a grey boxed border around the image, how can i make it disappear.
also, from where do i call my javascript code?


In your css:

button{
margin:0;
padding:0;
border:0;
}

Not a javscript guy but:
<button type=submit onclick="alert(''hello'')"><img src="image.png" border="0" alt="Continue to the next page" />


这篇关于在提交按钮上使用图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆