.net + html 同意注册
.net 功能十分强大,其实可以直接在里面写一些html的代码,比如像这样
<asp:CheckBox ID="checksingup" runat="server" Text='I have read and agree to <a href="abc.aspx">This is ABC web</a>' onclick="ValidateTandCs" />
这种可以用于注册时的超链接到别的地方,当然可以发挥想像,所有Text都可以这么用。
<asp:CustomValidator ID="cvTerms" runat="server" ValidationGroup="signupGroup" Display="Dynamic"
ClientValidationFunction="ValidateTandCs" EnableViewState="false" ErrorMessage="<%$Resources:Message,needagree%>" />
//这边errormessage是调用全域的message这样改起来会更方便些
<script language="javascript" type="text/javascript">
function ValidateTandCs(source, args)
{
args.IsValid = document.getElementById('<%= checksingup.ClientID %>').checked;
}
</script>
对于js,这里.net得到当的方法还是很多的,这也是其中一种
相关文档:
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="retu ......
关于Html
form
表单的提交,很容易。。。但如果不仔细还是能有很多错误。
提交的button name 属性为 submit form
的submit方法失效
。代码如下
# < html >
# < head > </ head >
# < script type = "text/javascript" >
# function getData(){
# ......
HTML中Select不用Disabled实现ReadOnly的另类实现.
<select onbeforeactivate="return false" onfocus="this.blur()" onmouseover="this.setCapture()" onmouseout="this.releaseCapture()">
<option>1</option>
</select> ......