I want validation For TextBox And TextBox is List Type So How To Validate Using JavaScript.
The Following Validation I want :-
TextBox Should Not Be Empty
No Duplication
Given Below Is My Code
@model List
@using (Html.BeginForm("CreateCategory", "CategoryAndSubCategory", FormMethod.Post, new { enctype = "multipart/form-data", @id = "category" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.Label("Category Name", htmlAttributes: new { @class = "control-label col-md-2 required" })
@Html.EditorFor(a => a[j].Category, new { @class = "form-control", @placeholder = "Enter Category Name", @style = "text-transform: capitalize" })
@Html.ValidationMessageFor(a => a[j].Category, "", new { @class = "text-danger" })
}
}


Catcher WongRank #286 · 8.8K reputationPosted Feb 3, 2017, 9:59 PM EST
Dr.Ajay KashyapRank #2,900 · 496 reputationPosted Feb 4, 2017, 8:32 PM EST
Catcher Wong Sir I want JavaScript Validation Not Model Validation
Catcher WongRank #286 · 8.8K reputationPosted Feb 4, 2017, 9:38 PM EST