Auto-selecting "State" and "Country" drop-down values with Customer Recordset
I am successfully auto-populating the Customer Billing Information on the checkout.php page (checkout wizard) with bindings from an added Customer Table Recordset filtered on a "username" session variable (email address). The only snag are the two drop-downs for the "Country" and "State".
What PHP coding do I need to set these values via filtered recordset upon page load? I have pasted sample coding for what works (Address_2) and for what doesn't (Country drop-down).
Any help you can give me would be much appreciated.
Thanks a lot!
Brad Uhl
--------------------------------------------------
<div class="lineGroup">
<div class="fullColumnGroup">
<label for="Address_2" class="sublabel" > Street 2:</label>
<input id="Address_2" name="Address_2" type="text" value="<?php echo($rs_customers->getColumnVal("CustAddress2")); ?>" class="formTextfield_Large" tabindex="7" title="Please enter your address">
</div>
</div>
<div class="lineGroup">
<div class="fullColumnGroup">
<label for="Country" class="sublabel" > Country:<span class="requiredIndicator"> *</span></label>
<select class="formMenufield_Medium" name="Country" id="Country" rel="<?php echo(WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Basic_Default","Country"),(isset($_GET["invalid"])?ValidatedField("catconfirmcart","Country"):"")))); ?>" tabindex="8" title="Please select your country." required>
<option value="" <?php if (!(strcmp("", WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Basic_Default","Country"),(isset($_GET["invalid"])?ValidatedField("catconfirmcart","Country"):"")))))) {echo "selected=\"selected\"";} ?>>Select Country</option>
<option value="US" <?php if (!(strcmp("US", WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Basic_Default","Country"),(isset($_GET["invalid"])?ValidatedField("catconfirmcart","Country"):"")))))) {echo "selected=\"selected\"";} ?>>United States</option>
<option value="GB" <?php if (!(strcmp("GB", WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Basic_Default","Country"),(isset($_GET["invalid"])?ValidatedField("catconfirmcart","Country"):"")))))) {echo "selected=\"selected\"";} ?>>United Kingdom</option>
<option value="AL" <?php if (!(strcmp("AL", WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Basic_Default","Country"),(isset
etc...
----------------------------------------------