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

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

  console.log('app address add click ready')

    e.preventDefault();

    let user = JSON.parse(localStorage.getItem('f05_user'));

    const label = $('#ad_label').val();

    const name = $('#ad_name').val();

    const phone = $('#ad_phone').val();

    const address = $('#ad_address').val();

    const rt = $('#ad_rt').val();

    const rw = $('#ad_rw').val();

    const no = $('#ad_no').val();

    const postcode = $('#ad_postcode').val();

    const kel = $('#ad_kel').val();

    const kec = $('#ad_kec').val();

    const city = $('#ad_city').val();

    const gmap = $('#ad_gmap').val();

    const remark = $('#ad_remark').val();

    const token=user.sess_token;

    const uuid=user.uuid;

    let req = {

      label,name,uuid,token,phone,address,rt,rw,no,postcode,kel,kec,city,gmap,remark

    }

    if (name && phone && address && no && gmap) {

      address_add(req);

    } else {

      app.dialog.alert("All fields are required", "Add Address Errors");

    }

  });

})