Alert when the billing info address and the shipping info address are the same
<p>I've built and order object which outputs the current variables as shown below.</p>

<p>I would like the alert to be...the two divs highlighted green. I'm assuming i'll need to incorporate some jquery.. here's what i have:</p>

<pre><code>&lt;div class='address_info left'&gt;
            &lt;h3&gt;Billing Info&lt;/h3&gt;
            &lt;ul&gt;
                &lt;li&gt;&lt;label&gt;Account No: &lt;/label&gt;&lt;?php echo $order-&gt;patient_id;?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Name: &lt;/label&gt;&lt;?php echo trim($order-&gt;billing_address['name']); ?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Address 1: &lt;/label&gt;&lt;?php echo trim($order-&gt;billing_address['addr1']);?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Address 2: &lt;/label&gt;&lt;?php echo trim($order-&gt;billing_address['addr2']);?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;City, State, Zip:&lt;/label&gt;&lt;?php echo trim($order-&gt;billing_address['city'] . ' ' . $order-&gt;billing_address['state'] . ' ' . $order-&gt;billing_address['zip']);?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Email: &lt;/label&gt;&lt;a href='mailto:&lt;?php echo $order-&gt;customer_email;?&gt;'&gt;Send Customer Email&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Phone: &lt;/label&gt;&lt;?php echo $order-&gt;customer_phone;?&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;  
        &lt;div class='address_info right'&gt;
            &lt;h3&gt;Shipping Info&lt;/h3&gt;
            &lt;ul&gt;
                &lt;li&gt;&lt;label&gt;Name: &lt;/label&gt;&lt;?php echo $order-&gt;shipping_address['name']; ?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Address 1: &lt;/label&gt;&lt;?php echo $order-&gt;shipping_address['addr1'];?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;Address 2: &lt;/label&gt;&lt;?php echo $order-&gt;shipping_address['addr2'];?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;City, State, Zip:&lt;/label&gt;&lt;?php echo $order-&gt;shipping_address['city'] . ' ' . $order-&gt;shipping_address['state'] . ' ' . $order-&gt;shipping_address['zip']?&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;&lt;/label&gt;&lt;/li&gt;
                &lt;li&gt;&lt;label&gt;&lt;/label&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
</code></pre>

<p>I'm currently using some css on hover for colors.</p>

<pre><code>div.address_info.left:hover {
    background: red;
    color: #fff; }

div.address_info.right:hover {
    background: #5C991F;
    color: #fff; }

div.order_info:hover {
    background: #3366FF;
    color: #fff; }
</code></pre>

<p>So here's my update:</p>

<pre><code>if (count(array_diff($this-&gt;billing_address, $this-&gt;shipping_address)) &gt; 0)
            return false;
        else
            return true;
</code></pre>

<p>I guess my real question is how to run a jquery event on my data. Sorry for  being so vague again at the start.. i guess we didn't get off on the right foot. Would love some help with the jQuery though. Thanks in advance.</p>

<p>Thanks for all the help.. i figured it out!</p>

<pre><code>if($order-&gt;check_addresses())
    $class='same';
else
    $class='different';

    &lt;div class='address_info left &lt;?php echo $class; ?&gt;'&gt;
         &lt;div class='address_info right &lt;?php echo $class; ?&gt;'&gt;
</code></pre>

<p>and than the css</p>

<pre><code>div.same {background-color: green;}
div.different {background-color: red;}
</code></pre>
