Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- jQuery(document).ready(function($) {
- // Tracks changes billing_state field
- $('#billing_state').change(function() {
- var selectedState = $(this).val();
- // Check if the selected area is "BG-22" (for Sofia)
- if (selectedState === 'BG-22') {
- // Sets the value of the city field to "Sofia"
- $('#billing_city').val('София');
- } else {
- // Otherwise, clear the city field value
- $('#billing_city').val('');
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement