$$(document).on('page:init', '.page[data-name="bank_add"]', function(e) {

  $(document).off("click", "#bank_add_button").on("click", "#bank_add_button", function(e) {

    e.preventDefault();

    const cif = $('#b3_name').val();

    const account_name= $('#b3_account_name').val();

    const bank_name= $('#b3_bank_name').val();

    const swift_code= $('#b3_swift_code').val();

    const account_number= $('#b3_account_number').val();

    const currency= $('#b3_currency').val();



    let req = {

      cif,account_name,bank_name,swift_code,account_number,currency

    }

    if (account_number && bank_name) {

      bank_add(req);

    } else {

      app.dialog.alert("All fields are required", "Bank Account Edit Errors");

    }

  });

})