How to pull a value from an auto suggest field then select all from database?
<p>I need to create some dynamic functionality and am unsure of where to begin. I have a page where you can create a Contact, we have an auto suggest field for "Company Name", this populates with all the companies you've created from within the application. </p>

<p>You then have the option to fill out the address for the Contact your creating, we want a checkbox that reads, "Same as company", so when checked, it'll populate all the fields with that companies address information.</p>

<p>I know how to do the final piece in jQuery, however, how do I dynamically pull the value from the auto suggest field and look it up in the database to pull the address data?</p>

<p>Do I need to setup a variable that is equal to the value in this field? <code>(company_name)</code>.
Then do </p>

<pre><code>SELECT * from companies where company_name = company_name
</code></pre>

<p>Do I already have access to the data I need or do I need to do more work?</p>
