JS to mooTools friendly version.

    Date: 11/07/07 (Javascript Community)    Keywords: no keywords

    I'm trying to convert this:
    function multiShip(){
    var qty = document.forms.cart.quantity.value;
    if(qty > 1) {
    document.forms.cart.shipMultiple.style.display="block"
    return false;
    }
    else if(qty >=11 || qty <= 1) {
    document.forms.cart.shipMultiple.style.display="none"
    return false;
    }
    else return true;
    }

    to something like this:

    window.addEvent('domready', function() {
    var qty = $('quantity'), ship = $('shipMultiple');
    });
    $('quantity').addEvents({
    'keyup': function() {
    if (qty.value.contains('> 1')) qty.fireEvent('show', 'block');
    else if (qty.value.contains('<= 1')) qty.fireEvent('show', '');
    else if (qty.value.contains('> 10')) qty.fireEvent('show', '');
    },
    'show': function(display) {
    ship.style.display='block';
    });
    });

    Anyone have any ideas? Right now, no errors, but also no function.

    What it's supposed to do, is you enter in a textbox a quantity of 1-10.
    1 or 10+ does nothing, 2-10 will reveal a "ship to" box.

    Source: http://community.livejournal.com/javascript/144396.html

« Pressing enter in a form... || stupid question... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home