d93220dc80a6f12eb516471427167283b20ccecd
angie
  Wed May 31 14:40:58 2017 -0700
Don't name buttons "submit" when we're going to invoke the function document.formName.submit() because document.formName.submit will point to the button instead of the function.  refs #18305 note-47

diff --git src/hg/lib/vcfUi.c src/hg/lib/vcfUi.c
index 0ef5dde..fb656be 100644
--- src/hg/lib/vcfUi.c
+++ src/hg/lib/vcfUi.c
@@ -51,82 +51,82 @@
     printf("<TABLE cellpadding=0><TR><TD>"
 	   "<B>Haplotype sorting order:</B> using ");
     char *centerChrom = cartOptionalStringClosestToHome(cart, tdb, parentLevel,
 							"centerVariantChrom");
     if (isEmpty(centerChrom))
 	{
 	// Unspecified in cart -- describe the default action
 	printf(VCF_HAPLOSORT_DEFAULT_DESC " as anchor.</TD></TR>\n");
 	if (isNotEmpty(thisChrom))
 	    {
 	    // but we do have a candidate, so offer to make it the center:
 	    puts("<TR><TD>");
 	    vcfCfgHaplotypeCenterHiddens(track, thisName, thisChrom, thisPos);
 	    char label[256];
 	    safef(label, sizeof(label), "Use %s", nameOrDefault(thisName, "this variant"));
-	    cgiMakeButton("submit", label);
+	    cgiMakeButton("setCenterSubmit", label);
 	    printf(" as anchor</TD></TR>\n");
 	    }
 	else
 	    printf("<TR><TD>To anchor the sorting to a particular variant, "
 		   "click on the variant in the genome browser, "
 		   "and then click on the 'Use this variant' button on the next page."
 		   "</TD></TR>\n");
 	}
     else
 	{
 	// Describe the one specified in cart.
 	int centerPos = cartUsualIntClosestToHome(cart, tdb, parentLevel, "centerVariantPos",
 						  -1);
 	char *centerName = cartStringClosestToHome(cart, tdb, parentLevel, "centerVariantName");
 	if (isNotEmpty(thisChrom))
 	    {
 	    // These form inputs are for either "use me" or clear:
 	    vcfCfgHaplotypeCenterHiddens(track, thisName, thisChrom, thisPos);
 	    // Is this variant the same as the center variant specified in cart?
 	    if (sameString(thisChrom, centerChrom) && sameString(thisName, centerName) &&
 		thisPos == centerPos)
 		printf("this variant as anchor.</TD></TR>\n");
 	    else
 		{
 		// make a "use me" button
 		printf("%s at %s:%d as anchor.</TD></TR>\n<TR><TD>\n",
 		       nameOrDefault(centerName, "variant"), centerChrom, centerPos+1);
 		char label[256];
 		safef(label, sizeof(label), "Use %s", nameOrDefault(thisName, "this variant"));
-		cgiMakeButton("submit", label);
+		cgiMakeButton("replaceCenterSubmit", label);
 		printf(" as anchor</TD></TR>\n");
 		}
 	    }
 	else
 	    {
 	    // Form inputs (in case the clear button is clicked)
 	    vcfCfgHaplotypeCenterHiddens(track, centerName, centerChrom, centerPos);
 	    printf("%s at %s:%d as anchor.</TD></TR>\n",
 		   nameOrDefault(centerName, "variant"), centerChrom, centerPos+1);
 	    }
 	// Make a clear button that modifies the hiddens using onClick
 	puts("<TR><TD>");
 	struct dyString *onClick = dyStringNew(0);
 	dyStringPrintf(onClick, "updateOrMakeNamedVariable(%s, '%s.centerVariantChrom', ''); ",
 		       formName, track);
 	dyStringPrintf(onClick, "updateOrMakeNamedVariable(%s, '%s.centerVariantName', ''); ",
 		       formName, track);
 	dyStringPrintf(onClick, "updateOrMakeNamedVariable(%s, '%s.centerVariantPos', 0);",
 		       formName, track);
 	dyStringPrintf(onClick, "document.%s.submit(); return false;", formName);
-	cgiMakeButtonWithOnClick("submit", "Clear selection", NULL, onClick->string);
+	cgiMakeButtonWithOnClick("clearCenterSubmit", "Clear selection", NULL, onClick->string);
 	printf(" (use " VCF_HAPLOSORT_DEFAULT_DESC ")</TD></TR>\n");
 	}
     puts("</TABLE>");
     }
 }
 
 //TODO: share this code w/hgTracks, hgc in hg/lib/vcfFile.c
 static struct vcfFile *vcfHopefullyOpenHeader(struct cart *cart, struct trackDb *tdb)
 /* Defend against network errors and return the vcfFile object with header data, or NULL. */
 {
 knetUdcInstall();
 if (udcCacheTimeout() < 300)
     udcSetCacheTimeout(300);
 char *db = cartString(cart, "db");
 char *table = tdb->table;