in reply to Re: Javascript select and unselect all checkboxes not working in Perl CGI code
in thread Javascript select and unselect all checkboxes not working in Perl CGI code

Thanks soonix for your reply. I updated that section of code as follows from examples I've seen:

start_form(-name=>'forms'),

However, code still not working. Do you know correct syntax? Searching but haven't found anything PERL CGI related matching exactly call for code below:

my $JSCRIPT=<<EOF; function selectToggle(toggle, form) { var myForm = document.forms[form]; for( var i=0; i < myForm.length; i++ ) { if(toggle) { myForm.elements[i].checked = "checked"; } else { myForm.elements[i].checked = ""; } } } EOF

Any other ideas or suggestions?

Replies are listed 'Best First'.
Re^3: Javascript select and unselect all checkboxes not working in Perl CGI code
by poj (Abbot) on Jul 16, 2013 at 14:09 UTC
    The name should be 'theForm' as in the links
    print a( { href => "javascript:selectToggle(true, 'theForm');" }, "All +" ); print " | "; print a( { href => "javascript:selectToggle(false, 'theForm'); +" }, "None" );
    or change the links
    poj

      Thanks Soonix, code to call form below now allows selecting all or none for all checkboxes. I owe you a beer :)

      start_form(-name=>'theForm'),