<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
@using (Html.BeginForm("ActionName", "ControllerName", FormMethod.Get, new { id="FormName"}))
{
<text>Required Field:</text>
Write(Html.TextBox("id", "", new {@class = "required" }));
<input type="submit" value="Go" />
}
<script type="text/javascript">
$(document).ready(function () {
$("#FormName").validate();
});
</script>
No comments:
Post a Comment