1

I wrote some jQuery to update inputted vals to "currency" type, so that entering "1" would change to "1.00" on exit (blur), entering "2.5" would change to "2.50" etc.like so:

$(document).on("blur", '[id$=boxAmount1]', function (e) {        $('[id$=boxAmount1]').val(parseFloat($('[id$=boxAmount1]').val()).toFixed(2));
});

$(document).on("blur", '[id$=boxAmount2]', function (e) {        $('[id$=boxAmount2]').val(parseFloat($('[id$=boxAmount2]').val()).toFixed(2));
});

(etc.)

The MaskMoney plugin is supposed to do all this with:

$('[id*=boxAmount]').maskMoney();

The problem is that this has the Clippy-like behavior of jumping to my "assistance" too quickly, and blocking attempts to undo its overeager guesses. What I mean is, on entering a "boxamount" input text element, "0.00" is added. If I want to enter some value, it adds that somewhere within the "0.00", resulting in a Frankensteining of the value; if I try to backspace over the value to remove it so as to "start from scratch," it disallows that. It becomes sort of a Pandora's Textbox - once a value has been generated for it, it won't go away.

Is there a way to tame this potentially useful beast?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.