On my input id='currency'
First I want maskMoney for currency format
$(function () {
$("#currency").maskMoney();
})
Then auto submit
$('#currency').change(function () {
$(this).closest("form").submit();
});
How to make it work together?
Update : Code
<?php
if($_POST) {
print_r($_POST);
}
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://padmin.googlecode.com/svn-history/r21/trunk/scripts/jquery.maskMoney.0.2.js"></script>
<script>
$(function() {
$("#currency").change(function() {
$(this).closest("form").submit();
}).maskMoney();
});
</script>
<form action="" method="post">
<input type="text" name="currency" id="currency" />
</form>
They can be separate (as long as the first is in a
document.readyhandler) or combined in a chain, like this: