<!--- This javascript is used to remove an option from the Select ------------------>
<Script language="javascript">
function removeOptions(selectbox)
{
var i;
var j;
for(i=selectbox.options.length-1;i>=0;i--)
{
if(selectbox.options[i].selected)
{
selectbox.remove(i);
j = i-1;
if(j>0)
{
selectbox.options[j].selected = true;
break;
}
}
}
}
</SCRIPT>
<!--- Start of the form --->
<CFFORM id="theform">
<TABLE>
<TR>
<TD valign=top>
<SELECT id="PID" name="PID" size="7" style="width: 350px;" onchange="document.theframe.location.href='calc.cfm';">
<CFLOOP Query="q">
<option value="#q.PID#" <CFIF q.CurrentRow eq 1>selected</CFIF>> #q.P#
</CFLOOP>
</SELECT>
</TD>
<TD valign=top>
<!--- This dynamically loads a block of HTML that contain HTML buttons, with JS attached, to update content of the iframe below --->
<!--- it is essentially loading different buttons that do different things, but all end with the onclick example below, which works fine:
<button name="x" id="x" onclick="removeOptions(PID);"></button>
--->
<CFDIV bind="cfc:C.showbuttons({PID})" id="buttons"></cfdiv>
</TD>
</TR>
</TABLE>
<TABLE>
<TR>
<TD valign=top colspan=3>
<CFDIV bind="cfc:C.showheading({PID})" id="bottomheading"></cfdiv>
</TD>
</TR>
<TR>
<TD valign=top><CFDIV style="width: 550px; overflow: auto;" bind="cfc:C.showdetails({PID})" id="bottom"></cfdiv></TD>
<TD valign=top style="width: 20px;"></TD>
<TD valign=top><iframe width="550" height="400" scrolling=no src="calc.cfm" name="theframe" id="theframe"></TD>
</TR>
</TABLE>
</CFFORM>
|