This is my first bootstrap/jQuery application.
I have an app that displays multiple addresses for a person and each address is editable by an Edit button.
I cannot figure out a way to click “edit” and then have ajax call a script to load that specific data from the database and then place it in a twitter modal window.
The edit button code is:
a class="btn btn-small open-EditAddress" data-toggle="modal" data-id="#custom.addr_id#" href="##edit_address_modal"><i class="icon-pencil"></i> Edit</a>
Each edit button passes the Addr_id, which would then trigger a twitter modal window with the data filled in for editing.
I have the modal edit firing, but not sure what to do next to load the external data into the modal for updating.


Can anyone assist with the jQuery to call the external data and load it in the modal?
update your
Editlink to look like this so that it does not trigger showing a modal when clicked:You don’t want to do that because you will be triggering that separately via JQuery after loading your form.
Also notice all these extra data attributes. They will enable an ajax call to populate your modal div with needed information.
Somewhere on the page you should have your modal element:
It is empty because it will be populated with an ajax call to the following Action:
Here is your partial view
_EditAddress.cshtml:So far when you click on the edit link, it will trigger an Ajax call Action
ActionNameToGetAddressInfoand put its results intodivwithid="ModalEditAddress". When this happens it will run the script at the very buttom of the partial view and show the modal.You will have to write another action to save address and some JQuery to hide modal when its saved.
This is all pseudo code so some adjustments may need to be done to it so that it works.