On Sep 24, 7:31 am, ColinFine <[EMAIL PROTECTED]> wrote: > On Sep 24, 1:06 am, Mardo <[EMAIL PROTECTED]> wrote: > > > Does anyone know how I could get all the textbox's with a > > name='PaymentAmount' and background color of blue? > > > I would like to enumerate these and get the total. > > > Any help would be much appreciated. > > $$('[name="PaymentAmount"]) will return you a Prototype Array of all > the elements with that name. (If you want to restrict it to textboxes, > you could use > 'input[type="text"][name="PaymentAmount"]'. > > I'm not sure about the background colour, since a) that is not a > attribute, but part of the value of an attribute, and b) 'blue' is not > a real value. > > I suspect you need something like > > $$('[name="PaymentAmount"]').findAll(function(e) {e.style.background- > color == #0F0}) > > but I'm not sure of the syntax for colour values. Also, this will
The results are typically inconsistent: element.getStyle('backgroundColor'); /* IE 7: '#fcc' Opera 9.5: '#ffcccc' WebKit: 'rgb(255, 204, 204)' FF 3.0.1: 'rgb(255, 204, 204)' */ -- kangax --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---