I am using a Drupal content type that presents a data entry form for something like a "Contact Record". Unfortunately the site is non-disclosure so I cannot post a link, but it's pretty basic. As a given Contact (being data entered) is a member of a company (presumably), I have a form input I call field_contact_organization. What I must solve is how to have the Contact Shipping Address fields kind of auto-populate once an organization has been specified in that field_contact_organization field. All the organizations (and their shipping fields) are already defined and sitting in a mySQL table called table_organizations.
1. Grabs the .innerHtml content of what was placed in the field...
2. Runs an SQL query on table_organization WHERE organization_title == field_contact_organization.innerHtml and fetches that whole record, and stuffs it into a new Array
Help! I cannot get my head around the techniques required to implement my approach here.
3. and embarrassingly, once the MySQL array has run, how do I either continue the JS function or call a new one that will populate the forms Address fields' .innerHTML with the array values?
I HAVE been attempting examples from all over the web but time to solve this has long since run out and I must implement this quite right away. Thanks in advance for any stab at this you can offer. Monitoring... :-)