Here is the piece of code that i am using. I have to show the country code automatically based on selected country by the user.
I have a database which has both, the countries and corresponding country code.
Now in the line where currently I am showing +91 how can i put the logic to do the same ?
Here is the code --
<div class="phone-number-verify-widget">
<p class="pnaw-verification-error"></p>
<div class="pnaw-step1">
<div class="phone-number-input-widget" id="phone-number-input-widget-d04854e1">
<label for="phone_country">Choose a country:</label>
<div class="select">
<select id="phone_country" name="phone_country">
<option value="AF" data-prefix="93">Afghanistan</option>
<option value="AD" data-prefix="376">....
<option value="ZW" data-prefix="263">Zimbabwe</option>
</select>
</div>
<label for="phone_number">Add a phone number:</label>
<div class="pniw-number-container clearfix">
**<div class="pniw-number-prefix">+91</div>**
<input type="text" class="pniw-number" id="phone_number">
</div>
<input type="hidden" data-role="phone_number" name="phone" value="91">
<input type="hidden" name="user_id" value="19935817">
</div>
Kindly guide.