ReportingAnalyst
MIS
I have a Javascript function that toggles the visibility of 2 different divs:
My error is at line no 14 which is:
I have a form element within the script:
And my div tags are like this:
[code<div id="commpay" name="commpay" style="display:none;">
Commission arrives here
</div>
<div id="salesrank" name="salesrank" style="display:none;">
Sales arrives here
</div>
[/code]
Any ideas why I am getting the error?
Thanks.
Code:
function showHide(el)
{
var f = el.form;
for(var i=0; i<f.crystalradio.length; i++)
{
if( f.crystalradio[i].checked )
{
switch( f.crystalradio[i].value )
{
case 'CommissionStatement':
case 'PaymentReconciliation':
document.getElementById( 'commpay' ).style.display = 'block';
document.getElementById( 'salesrank' ).style.display = 'none';
//document.getElementById( 'quarter_perf_team' ).style.display = 'none';
//document.getElementById( 'quarter_Perf' ).style.display = 'none';
//document.getElementById( 'sales_prod' ).style.display = 'none';
break;
case 'SalesRanking':
document.getElementById( 'commpay' ).style.display = 'none';
document.getElementById( 'salesrank' ).style.display = 'block';
//document.getElementById( 'quarter_perf_team' ).style.display = 'none';
//document.getElementById( 'quarter_Perf' ).style.display = 'none';
//document.getElementById( 'sales_prod' ).style.display = 'none';
break;
}
}
}
}
My error is at line no 14 which is:
Code:
switch( f.crystalradio[i].value )
I have a form element within the script:
Code:
<form="Reports" Method="Post">
And my div tags are like this:
[code<div id="commpay" name="commpay" style="display:none;">
Commission arrives here
</div>
<div id="salesrank" name="salesrank" style="display:none;">
Sales arrives here
</div>
[/code]
Any ideas why I am getting the error?
Thanks.