Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnChange event not working -- Help Erwino!

Status
Not open for further replies.

jl8789

MIS
May 22, 2003
293
0
0
US
I appreciate your help tremendously. I am extremely new to javascript so bear with me...

I tried this, and it does not work.
Here is my query and javascript.

<cfquery name=&quot;errorcodes&quot; datasource=&quot;#datasource#&quot; username=&quot;#username#&quot; password=&quot;#password#&quot;>
select QEC_ERROR_CD_ID, QEC_ERROR_DESC, QEC_CSR_IMPACT_CD, QEC_CLEC_IMPACT_CD from QADS_ERROR_CODE
where QEC_ACTIVE_IND='A'
order by QEC_ERROR_DESC asc
</cfquery>

<SCRIPT Language='JavaScript'>
function errorChange()
{
var csr=new Array();
var clec=new Array();

csr[0] = &quot;&quot;; //initialize the arrays since currentrow will not be 0
clec[0] = &quot;&quot;;

<cfoutput query=&quot;errorcodes&quot;>
csr[#CurrentRow#] = &quot;#QEC_CSR_IMPACT_CD#&quot;;
clec[#CurrentRow#] = &quot;#QEC_CLEC_IMPACT_CD#&quot;;
</cfoutput>

if (csr[document.forms.errordetail.error_code_id.selectedIndex] == 'Y')
{
document.forms.errordetail.csr.checked=true;
}
else
{
document.forms.errordetail.csr.checked=false;
}

if (clec[document.forms.errordetail.error_code_id.selectedIndex] == 'Y')
{
document.forms.errordetail.clec.checked=true;
}
else
{
document.forms.errordetail.clec.checked=false;
}
}

</SCRIPT>

Here is my select:
<select ID=&quot;oSelect&quot; tabindex=&quot;10&quot; name=&quot;error_code_id&quot; STYLE=&quot;font:normal 10pt Arial&quot; onchange=&quot;errorChange();&quot;>
<cfoutput query=&quot;errorcodes&quot;>
<option value=&quot;#errorcodes.QEC_ERROR_CD_ID#&quot;>#errorcodes.QEC_ERROR_DESC#</option>
</cfoutput>
</select>

And here are my checkboxes:
<TD width=40% ALIGN=right><FONT class=&quot;stdheader&quot;>CSR Affecting: </FONT></td>
<TD width=60%><SPAN id='oCSR'><input name = &quot;CSR&quot; type=&quot;checkbox&quot;>
</SPAN>   <FONT class=&quot;stdheader&quot;>CLEC Affecting: </FONT>
<SPAN id='oCLEC'></SPAN><input name=&quot;CLEC&quot; type=&quot;checkbox&quot;></TD>

I want to load my arrays outside of the errorChange() function, but I wanted to try to see if this would work first by following some of the example you pointed me to.

Any Help is greatly appreciated!
 
Javascript is case sensitive

document.forms.errordetail.clec.checked
should be:
document.forms.errordetail.CLEC.checked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top