Hi
In below code i want to search say ddl1 selected value & then highlight Book Title
C#
htmlTable.Append("");
htmlTable.Append("" + colum.SessionDeliveryCalendarID + "");
htmlTable.Append("" + colum.BookID + "");
htmlTable.Append("" + Count.ToString() + "");
htmlTable.Append("" + colum.SessionDeliveryNo + "");
if (Res.BookAvailableForSession == true)
{
htmlTable.Append("" + Res.BookTitle + "");
}
PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });Thanks

Amit MohantyRank #112 · 20K reputationPosted Jun 13, 2023, 5:02 AM EDT
htmlTable.Append(""); htmlTable.Append("" + colum.SessionDeliveryCalendarID + ""); htmlTable.Append("" + colum.BookID + ""); htmlTable.Append("" + Count.ToString() + ""); htmlTable.Append("" + colum.SessionDeliveryNo + ""); if (Res.BookAvailableForSession == true) { string bookTitle = Res.BookTitle; string selectedValue = ddl1.SelectedValue; if (bookTitle.Equals(selectedValue)) { htmlTable.Append("" + bookTitle + ""); } else { htmlTable.Append("" + bookTitle + ""); } } htmlTable.Append(""); PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });Ramco RamcoRank #462 · 5.4K reputationPosted Jun 13, 2023, 5:16 AM EDT
Hi Amit
I need how to loop thru table using Javascript . If the selected dropdown value matches the column then it should highlight that column . I am trying something like below :
var ddl = document.getElementById("ddlBook"); alert(ddl); // Attach an event listener to the dropdown's change event ddl.addEventListener("change", function () { var selectedValue = ddl.value; });Thanks
Amit MohantyRank #112 · 20K reputationPosted Jun 13, 2023, 5:24 AM EDT
Check this
var ddl = document.getElementById("ddlBook"); // Attach an event listener to the dropdown's change event ddl.addEventListener("change", function () { var selectedValue = ddl.value; var table = document.getElementById("myTable"); // Replace "myTable" with the ID of your table for (var i = 0; i