Hello,

i try th second function but get no result:( WHere is the boxs definition?


var CheckboxTools = {
   toggle: function(seriesID) {
          // ID*  =  beinhaltet irgendwo, ID^ = nur am Anfang, ID$ nur am Ende
       var boxes = $$("input[type=checkbox][ID^="+seriesID+"]");
       if (boxes.length) {
         var toState = !boxes[0].checked;
         boxes.each(function(box) {
           box.checked = toState;
         });
      }
   },
   getCheckedValues: function(seriesID) {
     return 
$$("input[type=checkbox][seriesID^="+seriesID+"]").inject([], 
function(memo, box) {
       if (box.checked) memo.push(box.value);
       return memo;
     });
   }
};



>> and how can i get a list with th name and value/checked?
>>
>>   
>>> $$("input[type=checkbox][name*=part_of_the_name]").each(function(c) {
>>> c.checked = false; });
>>>     
> Try these (untested) functions below.  - Ken
> 
> var CheckboxTools = {
>   toggle: function(seriesName) {
>       var boxes = $$('input[name="'+seriesName+'"]');
>       if (boxes.length) {
>         var toState = !boxes[0].checked;
>         boxes.each(function(box) {
>           box.checked = toState;
>         });
>      }
>   },
>   getCheckedValues: function(seriesName) {
>     return $$('input[name="'+seriesName+'"]').inject([], function(memo, 
> box) {
>       if (box.checked) memo.push(box.value);
>       return memo;
>     });



____________
Virus checked by G DATA AntiVirusKit
Version: AVK 17.7945 from 20.09.2007
Virus news: www.antiviruslab.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to