Click here to Skip to main content
15,887,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
I am unable to validate below condition:

When user selects a dropdownlist(ddlLoanType) then user needs to select another two dropdownlist(ddlyear,ddlSection) for sure before click on submit button.
but if user enters a value in the textbox(ID,Name) then it is not mandatory to select the all dropdownlists(ddlLoanType,ddlYear,ddlSection).
If user selects a dropdownlist(ddlLoanTypes) then enters a value in textbox((ID,Name)) then it is not mandatory to select other two dropdownlists(ddlYear,ddlSection).

Any help is appreciated!!



<pre lang="c#">
SQL
@Html.DropDownListFor(model => model.LoanType, Model.LoanType, "Select", new { @class = "form-control", id = "ddlLoanType", placeholder = "Select" })

 @Html.DropDownListFor(model => model.Year, new SelectList(listItems), "Select", new { @class = "form-control", id = "ddlYear" })

 @Html.DropDownListFor(model => model.Sections, new SelectList(sectionLst), "Select", new { @class = "form-control", id = "ddlSection" })

  @Html.TextBoxFor(model => model.ID, new { @class = "form-control", placeholder = "Enter ID...", id = "ID" })

 @Html.TextBoxFor(model => model.name, new { @class = "form-control", placeholder = "Enter Name", id = "Name" })
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900