3ccff3eb89f715872f16acd1f65beef543de7c3e
angie
  Tue Sep 8 11:34:34 2015 -0700
Oops, forgot to use the previously selected CGI as the form's initial action.
refs #15517

diff --git src/hg/hgCustom/hgCustom.c src/hg/hgCustom/hgCustom.c
index 71a323d..df02b5a 100644
--- src/hg/hgCustom/hgCustom.c
+++ src/hg/hgCustom/hgCustom.c
@@ -644,40 +644,40 @@
 /* Return {value, label} pairs with other CGIs the user might wish to jump to. */
 {
 struct slPair *valsAndLabels = slPairNew(hgTracksName(), "Genome Browser");
 slAddHead(&valsAndLabels, slPairNew(hgTablesName(), "Table Browser"));
 slAddHead(&valsAndLabels, slPairNew(hgVaiName(), "Variant Annotation Integrator"));
 slAddHead(&valsAndLabels, slPairNew(hgIntegratorName(), "Data Integrator"));
 slReverse(&valsAndLabels);
 return valsAndLabels;
 }
 
 static void makeOtherCgiForm(char *pos)
 /* Make a form for navigating to other CGIs. */
 {
 struct slPair *valsAndLabels = makeOtherCgiValsAndLabels();
 // Default to the first CGI in the menu.
+#define hgCtNavDest "hgct_navDest"
 char *defaultCgi = valsAndLabels->name;
+char *selected = cartUsualString(cart, hgCtNavDest, defaultCgi);
 printf("<FORM STYLE=\"margin-bottom:0;\" METHOD=\"GET\" NAME=\"navForm\" ID=\"navForm\""
-       " ACTION=\"%s\">\n", defaultCgi);
+       " ACTION=\"%s\">\n", selected);
 cartSaveSession(cart);
 if (pos)
     cgiMakeHiddenVar("position", pos);
 printf("view in ");
 // Construct a menu of destination CGIs
-#define hgCtNavDest "hgct_navDest"
-char *selected = cartUsualString(cart, hgCtNavDest, defaultCgi);
 char *extraHtml = "id=\"navSelect\" "
     "onChange=\"var newVal = $('#navSelect').val(); $('#navForm').attr('action', newVal);\"";
 puts(cgiMakeSingleSelectDropList(hgCtNavDest, valsAndLabels, selected, NULL, NULL, extraHtml));
 cgiMakeButton("submit", "go");
 puts("</FORM>");
 }
 
 static void manageCustomForm(char *warn)
 /* list custom tracks and display checkboxes so user can select for delete */
 {
 
 struct dbDb *dbList = getCustomTrackDatabases();
 struct dbDb *dbDb = NULL;
 /* add this database to the list, as it may have no custom
  * tracks, but we still want to see it in the menu */