9de7f8216d1c43504692879cb61b76d55934a22f
chmalee
  Mon Nov 4 14:14:51 2024 -0800
Make drop down selects have a unique id from their parent, so document selectors work, refs #34759

diff --git src/hg/cgilib/search.c src/hg/cgilib/search.c
index 20f82b3..9cf7e4b 100644
--- src/hg/cgilib/search.c
+++ src/hg/cgilib/search.c
@@ -237,32 +237,33 @@
 
     // Right side select of vals
     safef(buf, sizeof(buf), "%s%i", METADATA_VALUE_PREFIX, row);
     enum cvSearchable searchBy = cvSearchMethod(mdbSelect->name);
     if (searchBy == cvSearchBySingleSelect || searchBy == cvSearchByMultiSelect)
         {
         dyStringPrintf(output,"</td>\n<td align='right' id='isLike%i' style='width:10px; "
                               "white-space:nowrap;'>is%s</td>\n<td nowrap id='%s' "
                               "style='max-width:600px;'>\n",
                               row,(searchBy == cvSearchByMultiSelect?" among":""),buf);
         struct slPair *pairs = mdbValLabelSearch(conn, mdbSelect->name, MDB_VAL_STD_TRUNCATION,
                                                  FALSE, !fileSearch, fileSearch);
                                                         // not tags, either a file or table search
         if (slCount(pairs) > 0)
             {
+            safef(id, sizeof id, "%i_select", row);
             char *dropDownHtml = cgiMakeSelectDropList((searchBy == cvSearchByMultiSelect),
-                                                buf, pairs,mdbSelect->val, ANYLABEL,"mdbVal",
+                                                id, pairs,mdbSelect->val, ANYLABEL,"mdbVal",
                                                 "change", "findTracks.mdbValChanged(this);",
                                                 "min-width:200px; font-size:.9em;", NULL);
             if (dropDownHtml)
                 {
                 dyStringAppend(output,dropDownHtml);
                 freeMem(dropDownHtml);
                 }
             slPairFreeList(&pairs);
             }
         }
     else if (searchBy == cvSearchByFreeText)
         {
         dyStringPrintf(output,"</td><td align='right' id='isLike%i' style='width:10px; "
                               "white-space:nowrap;'>contains</td>\n<td nowrap id='%s' "
                               "style='max-width:600px;'>\n",row,buf);