Harikanth Kompally

Harikanth Kompally

  • 1.6k
  • 120
  • 30.8k

Tab selection in mvc view

Sep 18 2017 6:40 AM
Hi every one
 
Am doing on tab selction
I have 5 tabs in view save button is in last tab
if i click on save button with out data shawing validation on fields and moving to the perticular tab which feild is empty in tab
 
so how write the code for moving to another please help me for this code
 
thank you
 
 am trying like this plaese check the below the code
 
function SaveValidations() {
debugger
var code = $("#UserDetailModel_Code").val();
if (code == "" || code == "0") {
//$('basicDetails').removeClass('active');
//$('branchDetails').addClass('active');
//var active_tab_selector = $('.nav-tabs > li.active > a').attr('basicDetails');
var target_tab_selector = $(this).attr('basicDetails');
//$(target_tab_selector).addClass('active');
$(target_tab_selector, '.nav-tabs > .active').prev('li').find('a').trigger('click');
//$(active_tab_selector).addClass('hide');
//$('basicDetails').addClass('active');
//var maptab = document.getElementById('basicDetails');
//maptab.className = maptab.className + ' active';
alert("Please Enter Code.");
//$("#basicDetails").focus();
//$("#tabs").tabs({ active: "#basicDetails" });
//$('#tabs a[href="#basicDetails"]').tab('show');
$("#UserDetailModel_Code").focus();
return false;
}
var name = $("#UserDetailModel_Name").val();
if (name == "" || name == "0") {
alert("Please Enter Name.");
$("#UserDetailModel_Name").focus();
return false;
}
var referedBy = $("#UserDetailModel_ReferredBy").val();
if (referedBy == "" || referedBy == "0") {
alert("Please Enter Refered By.");
$("#UserDetailModel_ReferredBy").focus();
return false;
}
}
 

Answers (1)