2
我正在尝试使用jQuery CSS框架来设置所需的字段错误样式。当表单在文本框中没有任何值提交时,应该阻止表单提交,并应显示与以下内容相对应的样式。错误状态样式的jQuery交互提示
•UI辅助性复位
•UI辅助-clearfix
•UI状态错误文本
•UI图标警报
什么最好的方法来做到这一点?
注:该代码对应于ASP.NET(form runat="server"
)
代码:
<html lang="en">
<head>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.6/jquery-ui.js"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.13/themes/flick/jquery-ui.css"
rel="stylesheet" type="text/css" />
<title>Interaction cues</title>
</head>
<body>
<%-- ui-helper-reset, ui-helper-clearfix, ui-state-error-text, ui-icon-alert--%>
<form runat="server" >
<div>
<a> User Name </a>
<input id="Text1" type="text" />
<span> * </span>
<a>Required field</a>
</div>
<input id="Button1" type="button" value="button" />
</form>
</body>
</html>
任何人都可以提供与此相关的任何链接? – Lijo 2012-02-17 10:36:17