[jQuery] Re: Port Prototype Code to jQuery?

2009-09-04 Thread Dave Methvin
Any thoughts on my previous reply? Leave the markup as-is and replace the Prototype script with this jQuery. I tried to make the selectors do most of the work, but it still has the downsides of the original code such as not validating price inputs. $(function(){ var calculate = function() {

[jQuery] Re: Port Prototype Code to jQuery?

2009-09-03 Thread Jermaine
Any thoughts on my previous reply? On Sep 2, 9:51 am, Jermaine jermaine2...@gmail.com wrote: @Josh Powell: Sure here is the full source in HTML (below you'll find the Javascript Source written in Prototype) HTML:

[jQuery] Re: Port Prototype Code to jQuery?

2009-09-02 Thread Jermaine
@Josh Powell: Sure here is the full source in HTML (below you'll find the Javascript Source written in Prototype) HTML: script type=text/javascript

[jQuery] Re: Port Prototype Code to jQuery?

2009-09-01 Thread Josh Powell
can you send the html too?

[jQuery] Re: Port Prototype Code to jQuery?

2009-09-01 Thread Ricardo
This should work, at least the logic is transposed: $('.fieldpair').each(function(){ var self = $(this); if (self.find('input:checked').length){ total += +self.find('input:text').val(); } }); On Sep 1, 10:08 am, Jermaine jermaine2...@gmail.com wrote: Hi All, I want to

[jQuery] Re: Port Prototype Code to jQuery?

2009-09-01 Thread Dave Methvin
I think you can let the selector do all the work: var sum = 0; $(.fieldpair :checked + :text).each(function(){ sum += +this.value; }); It's rare I ever find a use for the sibling selector!