<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1 align="center" style="color: red">用户留言簿</h1>
<hr color="red" />
<form action="baidu.html" method="post">
<table border="1" cellspacing="0" bordercolor="black" align="center" width="700px" height="300px" style="color: blue">
<tr>
<td width="100" height="50">用 户 名:</td>
<td><input type="text" name="name" /></td>
<td>密 码:</td>
<td><input type="password" name="pwd" /></td>
</tr>
<tr>
<td width="100" height="50">电子信箱:</td>
<td><input type="text" name="email" /></td>
<td>民 族:</td>
<td>
<select name="名族">
<option value="汉族" selected="selected">汉族</option>
<option value="少数名族">少数民族</option>
</select>
</td>
</tr>
<tr>
<td width="100" height="50">性 别:</td>
<td><input type="text" name="sex" />
<input type="radio" name="sex" value="男" checked="checked" />
<input type="radio" name="sex" value="女" />
</td>
<td>爱 好</td>
<td>
<input type="checkbox" name="lanqiu" value="aihao" />篮球
<input type="checkbox" name="zuqiu" value="aihao" />足球
<input type="checkbox" name="paiqiu" value="aihao" />排球
<input type="checkbox" name="qita" value="aihao" />其它
</td>
</tr>
<tr>
<td width="100" height="100">留 言:</td>
<td colspan="4">
<textarea name="liuyan" rows="5" cols="50">请多多指教</textarea>
</td>
</tr>
<tr>
<td height="50" colspan="5" align="center">
<input type="submit" value="确定" />
<input type="reset" value="重写" />
</td>
</tr>
</table>
</form>
</body>
</html>
HTML 代码留言板 一个超简陋的留言版 免费留言板 //评论内容不能保存 因为涉及到数据库<script>
function Ok_OnClick(event)
{
if(document.getElementsByName("textName")[0].value == ""){
alert("请输入内容")
return
}//getElementById
var table
var tableList = document.getElementsByTagName("TABLE")
for(var i = 0 i <tableList.length i++) {
if(tableList[i].name == "tableName") {
table = tableList[i]
break
}
}
var value = document.getElementsByName("textName")[0].value
var index = table.rows.length
table.insertRow(index)
table.rows(index).insertCell(0)
table.rows(index).cells(0).innerText = value
document.getElementsByName("textName")[0].value = ""
}
</script>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/htmlcharset=gb2312">
<TITLE>留言版</TITLE>
<STYLE>
td{width:20%height:20pxborder-bottom:1px solid blackborder-right:1px solid blackcursor:default}
div{font-size:13px}
th{height:20pxfont-size:12pxfont-weight:normalborder-bottom:2px solid blackbackground-color:#CCCCCC}
table{border:1px solid blackfont-size:13px}
</STYLE>
</HEAD>
<BODY oncontextmenu="return false"">
<TABLE name="tableName" width="70%" align="center" cellpadding="0" cellspacing="0">
<TR>
<TH colspan="4" style="">留言版</TH>
</TR>
<TR>
<TD>呵呵,一个超简陋的留言版 ^_^</TD>
</TR>
</TABLE>
<BR>
<div align="center">
<textarea rows="2" name="textName" id="textId" cols="20"
style="width: 70%clip: rect(0pt, 47pt, 18pt, 0pt)font-family: 宋体font-size: 10ptfont-weight: normalfont-style: normaltext-align: leftvertical-align: middletext-indent: 0color: #000000background-attachment: fixedbackground-color: #EEEEEEborder: 1px solid #0xf8f8f8">
</textarea>
</div>
<BR>
<div align="center">
<input type="button" value="提交" onclick="return Ok_OnClick(window.event)"
style="align:center width:60 height: 21clip: rect(0pt, 47pt, 18pt, 0pt)font-family: 宋体font-size: 10ptfont-weight: normalfont-style: normalcursor: handtext-align: centervertical-align: middletext-indent: 0color: #000000background-attachment: fixedbackground-color: #d8d8d8border: 1px solid #59b4f7">
<!--position: absoluteleft: 342top: 184-->
</div>
</BODY>
</HTML>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)