umair mohsin

umair mohsin

  • 1.6k
  • 195
  • 28k

Validate dropdown in bootstrap multistep form

Jan 25 2020 2:41 AM
my app. is a  multistep form in a bootstrap Modal i want to validate  dropdown  if option is not selected.i have tried unobtrusive but it is not working as the form is multistep and data is not posting to server at each step.
 
i have validated textboxes and dropdowns too but dropdowns got null after jquery client side validation.i am enclosing the clip and need help if anyone has the solution for this. these dropdowns are populate through database code and when validate through jquery code these dropdwns are empty.Please help me regarding this.
 
validation code is something like this..............
 
 
$(document).ready(function () {
$(".step3").click(function () {
var index=$(".form-control");
if ($(".form-control").text("Select Gender"))
{
$("#forgen").text("*");
$("#foredu").text("*");
return false;
}
else {
$(".error").text(" ");
$("#myModal3").modal();
return true;
}
})
});
 
 
 
Note.this is MVC Based Application. 
 

Attachment: Before.rar

Answers (1)