0

hi i am working with a form in mvc4 using c#

 @using (Html.BeginForm("SendPassword", "Member", FormMethod.Post, new { id = "forgot", @class = "emlfrm" }))
{
<p @Html.DropDownListFor(model => model.Id,new SelectList(ViewBag.Users,"Id","Mem_NA"), "--Select Your Name--",string.Empty)<label id="error">       </label></p>
<p><label>Your Email</label><input type="text" class = "eml" name="email"/><label id="error">       </label></p>
<p><input type="submit" name="submit" value="Submit" /></p>
}

i am validating the email using jquery. i want to validate the dropdown list(if no item is selected show error when submit button is clicked). The values in the drop down list is added from sql table. How can i validate this.

4

0 回答 0