Home Populate WooCommerce Checkout form textbox on additional dropdown field selection
Reply: 0

Populate WooCommerce Checkout form textbox on additional dropdown field selection

Sam
1#
Sam Published in 2018-02-14 04:40:49Z

I am relatively inexperienced in Javascript and need some suggestions. In the WooCommerce Checkout form, I have added a field called billing_countrycode which is a dropdown selection of country telephone codes. I want this country code to be appended before the phone number which the customer enters in the phone number field. Below is how the HTML of the 2 fields i.e. the Dropdown for countrycode and the phone number field looks.

<p class="form-row form-row-wide validate-required woocommerce-validated" id="billing_countrycode_field" data-priority="100">
<label for="billing_countrycode" class="">Country Code <abbr class="required" title="required">*</abbr></label>
<select name="billing_countrycode" id="billing_countrycode" class="select thwcfd-enhanced-select select2-hidden-accessible enhanced" data-placeholder="+1" tabindex="-1" aria-hidden="true">                            
<option value="+1">+1</option>
<option value="+91">+91</option>
<option value="+52">+52</option>
<option value="+44">+44</option>
<option value="+33">+33</option>
<option value="+39">+39</option>
<option value="+49">+49</option>

<p class="form-row form-row-first validate-required validate-phone" id="billing_phone_field" data-priority="110">
<label for="billing_phone" class="">Phone <abbr class="required" title="required">*</abbr></label>
<input type="tel" class="input-text " name="billing_phone" id=" autocomplete="tel"></p>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.403026 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO