在网页中提交表单,用Button的话很难看,想让它好看一点,就用图片或者是链接;
但是试过好几种方法都没有成功;
笔记一下
js代码:
<script type="text/javascript">
function doLogin(){
document.login.action="test";//表单提交的
document.login.submit();
return true;
}
</script>
html代码:
<form id="login" name="login"
action="" method="post">
<table width="239" height="126" border="0" align="center"
cellpadding="2" cellspacing="2">
<tr>
<td width="60" align="center">用户名:</td>
<td width="159"><input type="text" name="textfield"
id="textfield">
</td>
</tr>
<tr>
<td align="center">密 码:</td>
<td><input type="text" name="password" id="password">
</td>
</tr>
<tr>
<td colspan="2" align="center"><img style="cursor: pointer;"
src="images/login_09.gif" width="72" height="26"
onClick="javascript:return doLogin();" /> <img style="cursor: pointer;"
src="images/login_10.gif" width="72" height="26" />
</td>
</tr>
</table>
</form>