close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Auto-selecting "State" and "Country" drop-down values with Customer Recordset

Thread began 1/02/2017 9:15 pm by braduhl | Last modified 1/03/2017 2:17 pm by Ray Borduin | 451 views | 3 replies |

braduhl

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">&nbsp;*</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...

----------------------------------------------

Sign in to reply to this post

Ray BorduinWebAssist

Find and replace.

Find: ValidatedField("catconfirmcart","Country"):""
Replace: ValidatedField("catconfirmcart","Country"):$rs_customers->getColumnVal("CustCountry")

(assuming your column name in the customers table is "CustCountry")

Sign in to reply to this post

braduhl

Originally Said By: Ray Borduin
  Find and replace.

Find: ValidatedField("catconfirmcart","Country"):""
Replace: ValidatedField("catconfirmcart","Country"):$rs_customers->getColumnVal("CustCountry")

(assuming your column name in the customers table is "CustCountry")  
Sign in to reply to this post

braduhl

Thank you very much Ray - I know you are busy and appreciate your taking time out to help all of us! I will test this out tonight...

Originally Said By: Ray Borduin
  Find and replace.

Find: ValidatedField("catconfirmcart","Country"):""
Replace: ValidatedField("catconfirmcart","Country"):$rs_customers->getColumnVal("CustCountry")

(assuming your column name in the customers table is "CustCountry")  
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...