I have a 3 tabs and 3 divs. second tab is active and what I want to do is on a click on a link button in second div to switch to third tab and show content of its div. The problem is that it will only switch for only 1 second and then revert back. It seems I can't put the code for a hyperlink ?? so I add a picture instead

jquery
JavaScript
$("#txtFormaManifestare").on("click", function () {
$("#MasuriTab").addClass("active");
$("#DivActivitateMasuriTab").addClass("active");
});

Marius VasileRank #785 · 2.9K reputationPosted Oct 22, 2023, 12:49 PM EDT
So I got a developing with
$("#txtFormaManifestare").on("click", function (e) { e.preventDefault(); $("#TabMasuri").tab("show"); });but the problem I have now is that txtFormaManifestare is a LinkButton in an asp.net c# app DataList. The jquery is working only with the first value from the DataList but not with others (values are listed below)
Marius VasileRank #785 · 2.9K reputationPosted Oct 24, 2023, 3:51 AM EDT
I manage to get it work from code behind. First I added a HiddenField containing active tab value and on link btn click I can change active tab
jquery
$(document).ready(function () { var tab = $("#ActiveTAB").val(); $(tab).tab("show"); });and code behing
protected void btnAddEvarisClick(object sender, EventArgs e) { //....some code here ActiveTAB.Value = "#TabEvaluare"; }