Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to create nav tab with javascript with validation to move to the next tab

$('#myTab a').on('click', function(e) {
  e.preventDefault();
  if (isValid()) {
    $(this).tab('show');
  }
});

function isValid() {
  const text = $("#homeText").val();
  if (text.length === 0) {
    return false;
  }
  return true;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #nav #tab #javascript #validation #move #tab
ADD COMMENT
Topic
Name
2+4 =