What I need to be able to do is when the user clicks on the Div that is created for the option I manually add for the new address (the line of code below) :
new Address(0, "NEW", "Add a new billing address", "", "", "", "", "", "", "", self.BillSelected),
Is trap the addressId == 0 and react to that and run some other javascript code to toggle the visibility of another div - I can't seem to trap the value of the selected address though - I have tried :
self.SelectBillAddress = function (address) {
self.BillSelected(address);
alert(self.BillSelected[0]);
alert(address[0]);
}
I just can't seem to trap which address it is they are clicking on to then be able to react to it?
Member
405 Points
519 Posts
Trap value in Knockout.js
Oct 24, 2016 03:53 PM|chilluk|LINK
On my MVC view I have a series of divs that represent choices of saved addresses - this is populated and controlled by some Knockout.js code :
What I need to be able to do is when the user clicks on the Div that is created for the option I manually add for the new address (the line of code below) :
Is trap the addressId == 0 and react to that and run some other javascript code to toggle the visibility of another div - I can't seem to trap the value of the selected address though - I have tried :
I just can't seem to trap which address it is they are clicking on to then be able to react to it?
Member
405 Points
519 Posts
Re: Trap value in Knockout.js
Oct 25, 2016 10:24 AM|chilluk|LINK
Solved it: