This probably has an easy solution but I sure can't figure it out.
I have a CFSELECT tag that uses values from a CFQUERY tag. In the CFSELECT tag I'm using the "onchange" attribute to pass the selected value to a javascript funtion. I'm using the following code to in the javascript function so that the alert Window shows the selected value but all I get is "0" or "NaN". What am I doing wrong?
<SCRIPT LANGUAGE="JavaScript">
function formHandler(form, menu2){
var PROJ = menufrm.menu2.options[menufrm.menu2.selectedIndex].value;
alert(+PROJ);
}
</SCRIPT>
<cfquery name="queryname" datasource="source">select ...</cfquery>
<cfform name="menufrm" >
<cfselect query="queryname" value="queryValue" name="menu2"
onchange="formHandler(this.form, this.form.menu2)">
<option> Unassigned</option>
</cfselect>
</cfform>
I have a CFSELECT tag that uses values from a CFQUERY tag. In the CFSELECT tag I'm using the "onchange" attribute to pass the selected value to a javascript funtion. I'm using the following code to in the javascript function so that the alert Window shows the selected value but all I get is "0" or "NaN". What am I doing wrong?
<SCRIPT LANGUAGE="JavaScript">
function formHandler(form, menu2){
var PROJ = menufrm.menu2.options[menufrm.menu2.selectedIndex].value;
alert(+PROJ);
}
</SCRIPT>
<cfquery name="queryname" datasource="source">select ...</cfquery>
<cfform name="menufrm" >
<cfselect query="queryname" value="queryValue" name="menu2"
onchange="formHandler(this.form, this.form.menu2)">
<option> Unassigned</option>
</cfselect>
</cfform>