I'm trying to have some code run when the Billing Address field (or sub-fields) of an Account is changed. This code will clean up the address, and then I want it to replace the contents of the Billing Address field with the cleaned up address without saving, so the user can preview the cleaned-up address.
Right now I'm trying to do this by editing the Account page layout to include an embedded VF page that contains javascript code. I found that the div that actually contains the address has id="acc17_ileinner".
I tried:
$(document).ready(function() {
alert($("#acc17_ileinner").html());
});
to see if I could access that div, but the alert said "undefined".
Do embedded VF pages use a separate document node? How can I access the standard field from a VF page embedded in the page layout of a standard object like Account?