cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Pre-filling Shipping address with values Jquery or Knockout Js

Magento 2 Pre-filling Shipping address with values Jquery or Knockout Js

Is it possible to fill the shipping address fields with my own values. For example, I want city field to be filled with "My City" when an event occurs on the checkout page. I know the checkout page uses Knockout JS that but I havnt figured out how to pass values to the fields themselves.

 

So far I have jquery running on the checkout page but writing code like:

    $('input[name="shippingAddress.city"]').val("My city");

 

does not seem to work.
I appreciate any help that anyone can give. Thanks.