Hi all,
The replies in this post sound very convincing, however, this post is just over my head and was hoping for some help:
I have code in my partial view that looks like this:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div class="messageBox1"></div>
<% Html.BeginForm("BusinessAdd", "Home", FormMethod.Post, new { id = "form1" }); %>
<label for="BusinessName">Business Name: </label>
<%= Html.TextBox("TxtBusinessName") %>
<a href="#" onclick="if ($('#form1').valid()) { $('#form1').submit(); } return false;">submit</a>
<script type="text/javascript">
$("#form1").validate({
errorLabelContainer: ".messageBox1",
rules: {
"TxtBusinessName": { required: true }
},
messages: {
"TxtBusinessName": { required: "Required field" }
}
});
</script>
<% Html.EndForm(); %>
Thanks, rodchar
P.S. Will this question get seen or should I have posted a new question and referenced this post?