Exclusive Select List Choices

[Total: 0    Average: 0/5]

Four select lists with exclusive choices.

Body Code:

<script>
function doIt(b)
{
  for (var i=0;i<4;i++)
  {
    for (var j=0;j<4;j++)
    {
	  if(i!=j)
	  {
	    var z=eval("document.f1.lstField"+i+".selectedIndex");
	    var y=eval("document.f1.lstField"+j+".selectedIndex");
		if(z && y && z==y)
		{
		  /* Uncomment if you want to have this alert notify the user
		   * alert("You have a conflict");
		   */
		  eval("document.f1.lstField"+b+".selectedIndex=0");
		  eval("document.f1.lstField"+b+".focus()");
		  return;
		}
	  }
    }
  }
}
</script>
<form name=f1>
<TABLE BORDER=0 CELLSPACING=10 CELLPADDING=0> 
<TR> 
<TD class=tag>Sort By:</TD> 
<TD> 
<SELECT size=1 id=lstField0 onchange="doIt(0)"> 
<option>Choose</option>
<OPTION SELECTED value="RevenueID">Order Number</OPTION> 
<OPTION value="LocalPurchaseTime">Date</OPTION> 
<OPTION value="ShippingMethodID">ShipDescription</OPTION> 
<OPTION value="TotalNumber">Total Cards</OPTION> 
</SELECT> 
<font color= olive>Ascending</font><INPUT type="radio" name=radio1 id=radio1 checked> 
<font color= olive>Descending</font><INPUT type="radio" name=radio1 id=radio1> 
</td> 
<TR> 
<TD class=tag>Sort By:</TD> 

<TD> 
<SELECT size=1 id=lstField1 onchange="doIt(1)"> 
<option>Choose</option>
<OPTION value="RevenueID">Order Number</OPTION> 
<OPTION value="LocalPurchaseTime" selected>Date</OPTION> 
<OPTION value="ShippingMethodID">ShipDescription</OPTION> 
<OPTION value="TotalNumber">Total Cards</OPTION> 
</SELECT> 
<font color= olive>Ascending</font><INPUT type="radio" id=radio3 name=radio3 checked> 
<font color= olive>Descending</font><INPUT type="radio" id=radio3 name=radio3> 
</td> 


<TR> 
<TD class=tag>Sort By:</TD> 
<TD> 
<SELECT size=1 id=lstField2 onchange="doIt(2)"> 
<option>Choose</option>
<OPTION value="RevenueID">Order Number</OPTION> 
<OPTION value="LocalPurchaseTime">Date</OPTION> 
<OPTION value="ShippingMethodID" selected>ShipDescription</OPTION> 
<OPTION value="TotalNumber">Total Cards</OPTION> 
</SELECT> 
<font color= olive>Ascending</font><INPUT type="radio" id=radio5 name=radio5 checked> 
<font color= olive>Descending</font><INPUT type="radio" name=radio5> 
</td> 

<TR> 
<TD class=tag>Sort By:</TD> 
<TD> 
<SELECT size=1 id=lstField3 onchange="doIt(3)"> 
<option>Choose</option>
<OPTION value="RevenueID">Order Number</OPTION> 
<OPTION value="LocalPurchaseTime">Date</OPTION> 
<OPTION value="ShippingMethodID">ShipDescription</OPTION> 
<OPTION value="TotalNumber" selected>Total Cards</OPTION> 
</SELECT> 
<font color= olive>Ascending</font><INPUT type="radio" id=radio7 name=radio7 checked> 
<font color= olive>Descending</font><INPUT type="radio" id=radio7 name=radio7> 
</td> 

<TD><BUTTON id="btnSearch" LANGUAGE=javascript onclick="return btnSearch_onclick()">GO</BUTTON></TD> 
</TR> 
<td><BUTTON id="btnSearch" LANGUAGE=javascript onclick="return btnstart_onclick()">Print</BUTTON></td> 
</TABLE> 
<div id="divShow"><div> 

</DIV> 
</form>

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *