用图片代替按钮提交表单之前如何验证表单.
我用一图片代替提交按钮如: <img src= "a.gif " onclick= "window.form.submit() ">
但是我在提交表单时想执行另一函数,如想调用验证表单域不能为空的函数,怎么做?
------解决方案-------------------- <script>
function func() {
return false;
}
</script>
<form name= "form ">
<img src= "a.gif " onclick= "func()?window.form.submit():alert( '不知道这个行不? '); ">
</form>
------解决方案-------------------- <img src= "a.gif " onclick= "aa( 'rrr '); ">
<input type = "text " name= "bb ">
<script language= "javascript ">
function aa(temp)
{
document.getElementById( "bb ").value=temp;
document.Form1.submit();
}
</script>
form1为Form的名字.