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() {
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:
@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
can you send the html too?
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
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!
6 matches
Mail list logo