const field = PeggyPay.getField('myFieldName'); field.onchange.add( function(field) { alert(field.getValue(); yourcode... } );