2

In html file, i could show the billing address prefix with text: currentBillingAddress().prefix. But when i tried to give data-bind to input, it become <input type="hidden" id="test2" data-bind="text: currentBillingAddress().prefix"/>Prefix</input>.

How can i set the value of input to billing address prefix? I already tried <input type="hidden" id="test2" input="text: currentBillingAddress().prefix"/> but it's not work.

1

You need to use data-bind:value property for set value in input tag.

<input type="hidden" id="test2" data-bind="value: currentBillingAddress().prefix"/>Prefix</input>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.