Skip Menu |

This queue is for tickets about the CGI-Ajax CPAN distribution.

Report information
The Basics
Id: 31391
Status: new
Priority: 0/
Queue: CGI-Ajax

People
Owner: Nobody in particular
Requestors: RBS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.701
Fixed in: (no value)



Subject: Patch to set checkbox value
This patch allows setting a checkbox's state using the result of a server-side function. Note that this uses Javascript's boolean interpretation rules, not Perl's. --- c:\perl\site\lib\CGI\Ajax.pm Tue Dec 11 21:20:04 2007 +++ lib\CGI\Ajax.pm Tue Dec 11 21:20:00 2007 @@ -923,7 +923,9 @@ var div = document.getElementById(dt[i]); if (div.type =='text' || div.type=='textarea' || div.type=='hidden' ) { div.value=data[i]; - } else{ + } else if (div.type =='checkbox') { + div.checked=data[i]; + } else { div.innerHTML = data[i]; } }