Hi All,
I am having a problem using Javascript in Perl script. In the perl module I have included the Javascript codes and that is workign fine for validation purpose but when I am trying to show and hide some divisions randomly selecting from a drop down menu then that is working fine in Mozilla but not working in IE 6/7. Here is some part of my code: if any suggestions please welcome...
Thanks,
Chittaranjan
This is the Javascript code I am using for div hiding and showing
This is the perl script drop down where I am calling the Javascript function
This is the div which I want to show and hide randomly selecting from the drop down.....
I am having a problem using Javascript in Perl script. In the perl module I have included the Javascript codes and that is workign fine for validation purpose but when I am trying to show and hide some divisions randomly selecting from a drop down menu then that is working fine in Mozilla but not working in IE 6/7. Here is some part of my code: if any suggestions please welcome...
Thanks,
Chittaranjan
This is the Javascript code I am using for div hiding and showing
Code:
<script type="text/javascript"> <!-- function showOptionals(field) { var loc = document.getElementById('noOfItems').value; for ( i = 1; i <= loc; i++ ) { var sel = document.getElementById('sel-tlcode-'+i).value; if ( i == sel ) { document.getElementById(i).style.display='block'; } else { document.getElementById(i).style.display='none'; } } } //--> </script>
Code:
print popup_menu( -name => 'sel-tlcode-' . $y, -id => 'sel-tlcode-' . $y, -value => \@xx, -default => $value{$label}, -class => ( $errLabel eq $label ) ? 'formmsg' : 'formelements', -title => 'Select a location code that corresponds with a location list in the section below.', -tabindex => $tabindex, -onChange => "showOptionals(this);", -force => 1 );
Code:
print "<div id=".$a." style=\"display:none\">";
Comment