日期:2014-05-18  浏览次数:20732 次

怎样实现点击图片触发onclik事件提交表单
怎么让点击图片提交表单呢!?
程序如下

<form   id= "Login "   method= "post "   action= "LoginCheck.aspx ">
用户名: <input   name= "LoginId "   type= "text "   class= "box "   size= "12 ">    
密 码:     <input   name= "LoginPass "   type= "password "   class= "box "   size= "12>
<img   src= "images/bc011.gif "   width= "54 "   height= "29 "   onClick= "return   Loginzctm(); ">
</form>

<script   language= "javascript ">
function   CheckPass()
{
setTimeout( "LoginCheck.submit() ",5000);
return   true;
}

这样用不行,点击图片没有反映,是哪里错了吗?
我想实现用图片来提交,做出来的按钮会漂亮点,这样做不能实现,是哪里错了吗?

------解决方案--------------------
我记得好像没问题
------解决方案--------------------
<form name= "LoginForm " method= "post " action= "LoginCheck.aspx ">
用户名: <input name= "LoginId " type= "text " class= "box " size= "12 ">
密 码: <input name= "LoginPass " type= "password " class= "box " size= "12>
<img src= "images/bc011.gif " width= "54 " height= "29 " onClick= "Loginzctm() ">
</form>

<script language= "javascript ">
function Loginzctm()
{
LoginForm.submit();
}
</script>

------解决方案--------------------
onClick= "return Loginzctm(); 但他找不到Loginzctm 注意看的话 左下脚 应该抱错的
------解决方案--------------------
<form id= "Login " method= "post " action= "LoginCheck.aspx ">
用户名: <input name= "LoginId " type= "text " class= "box " size= "12 ">
密 码: <input name= "LoginPass " type= "password " class= "box " size= "12>
<img src= "images/bc011.gif " width= "54 " height= "29 " onClick= "CheckPass() ">
</form>
<script language= "javascript ">
function CheckPass()
{
LoginCheck.submit();
}

------解决方案--------------------
<input name= "LoginPass " type= "password " class= "box " size= "12>

==> size= "12 " 少了一個引號。
------解决方案--------------------
<img src= "images/bc011.gif " width= "54 " height= "29 " onClick= "javascript:form1.submit() ">

------解决方案--------------------
我晕了.不就跟button一样的提交嘛,onclick事件中干嘛要用个return啊
------解决方案--------------------
这个应该不成问题啊
很多人都这样实现的,用工具自带的很少啦。
------解决方案--------------------
可以
------解决方案--------------------
不用搞什麼函數調用,直接加個圖片就OK
<body>
<table class=tab_red_l_r cellSpacing=0 cellPadding=0 width=650 align=center border=0>
<form method= "post " name= "frmLogin " action= "LoginServlet " onSubmit= "javaScript: return checkdata(); ">