Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Created February 16, 2013 21:33
Embed
What would you like to do?
// 'message' should be changed to match the name of your output box
var display = $('message').down('p').update();
new Form.Observer(document.forms[0], 0.3, function(form, value){
var vals = value.parseQuery(), message = '';
var amt = parseInt(vals.x, 10) * parseInt(vals.y, 10) * parseInt(vals.material, 10);
if(amt > 0){
message = (amt / 100).toFixed(2);
}
display.update(message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment