I want the user to choose his/her country from a drop-down list, Then I want to show the country code in a text field in order to allow the user to type his/her number.
This is the country list with the phone number code:
<select name="country">
<option value="">Country...</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
.
.
ETC till
<option value="Zimbabwe">Zimbabwe</option>
</select>
<label for="phone">Phone Number</label><
<input id="phone" name="phone" placeholder="user's number " required="" type="number">
When user choose Saudi Arabia for example
I want the text field to show 966
I thought about making the country code as value in the option
I found this similar case here but I prefer to make it as a second option