I got the solution for this.
Just Add This Code In Contact Form 7:
<select name="stt" id="sts" class="form-control" required="" onchange="print_city('state', this.selectedIndex);"></select>
<select name="city" id="state" class="form-control" required=""></select>
<script language="javascript">print_state("sts");</script>
And This In Functions.php
function my_theme_scripts_function() {
wp_enqueue_script( 'myscript', get_template_directory_uri() . '/cities.js');
}
add_action('wp_enqueue_scripts','my_theme_scripts_function');
You Can Take The Cities.js File From Here: https://github.com/ajayrandhawa/Indian-States-Cities-Database
In this, you can add cities you want.
For The Mail:
State: [stt]
City: [city]
This is the solution.
Related Posts:
- Reactjs – Form input validation
- Angular: mat-form-field must contain a MatFormFieldControl
- No value accessor for form control
- Send POST data using XMLHttpRequest
- Setting onSubmit in React.js
- jQuery AJAX submit form
- How to reset a form using jQuery with .reset() method
- JavaScript post request like a form submit
- How to create a HTML Cancel button that redirects to a URL
- What does ngf-select do and why is it needed for form validation?
- JavaScript post request like a form submit
- How can I get form data with JavaScript/jQuery?
- {“error”: “Please use POST request”} – alternative solution to submitting a form
- FormData append not working
- JavaScript code to stop form submission
- how to write javascript code inside php
- ngular is automatically adding ‘ng-invalid’ class on ‘required’ fields
- Add custom form to theme
- How to replace a javascript select box onchange event to a form submit action?
- How do I embed a Javascript form directly into a page?
- How to load javascript file on homepage in WordPress in order?
- How do you filter the list of states when country is selected? [closed]
- Uncaught ReferenceError: jQuery is not defined – although jQuery is loaded [closed]
- Why does a on Comment edit page submit the page?
- How to add “on change” to a text input in contact form7?
- Add captcha validation to my custom form for Frontend posting
- How to add a onclick attribute to a list of checkboxes?
- Close modal window after form submit [closed]
- Form will not popup, when clicking on the link to the form
- Can’t Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM
- Error handling for wpdb error – displaying an error message to the user
- How to change number field to text field using JS
- CCF7 Field numbuer prefilled after Click event
- Sending GravityForms to custom HTML
- How can I generate a rainbow circle using HTML5 canvas?
- Which equals operator (== vs ===) should be used in JavaScript comparisons?
- are there dictionaries in javascript like python?
- Use a JSON array with objects with javascript
- Toggle show/hide on click with jQuery
- Client on Node.js: Uncaught ReferenceError: require is not defined
- jQuery .on(‘change’, function() {} not triggering for dynamically created inputs
- How to create a jQuery function (a new jQuery method or plugin)?
- How do you check if a variable is an array in JavaScript?
- Understanding React-Redux and mapStateToProps()
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- How to get the browser to navigate to URL in JavaScript
- In angularjs we are having ng-disabled directive, why ng-enabled directive is not provided by the framework as we are having ng-show and ng-hide
- querySelector vs. getElementById
- Google weather widget on my website
- How to generate a simple popup using jQuery
- How to convert an Object {} to an Array [] of key-value pairs in JavaScript
- Javascript versioning to avoid caching, difference in these practices?
- SyntaxError: Unexpected token o in JSON at position 1
- When is JavaScript synchronous?
- Uncaught ReferenceError: Firebase is not defined
- Efficient way to implement Priority Queue in Javascript?
- How do you format a Date/Time in TypeScript?
- JavaScript function in href vs. onclick
- How to scroll to an element?
- Count the number of occurrences of a character in a string in Javascript
- Javascript removeEventListener not working
- Load image with jQuery and append it to the DOM
- RGB to hex and hex to RGB
- No visible cause for “Unexpected token ILLEGAL”
- Change text on hover, then return to the previous text
- How to do case insensitive string comparison?
- Understanding the ngRepeat ‘track by’ expression
- How can I test if a letter in a string is uppercase or lowercase using JavaScript?
- What does the construct x = x || y mean?
- How to get the first element of an array?
- How to instantiate a File object in JavaScript?
- How to change the buttons text using javascript
- Cannot read property ‘forEach’ of undefined
- JavaScript: function returning an object
- What is the non-jQuery equivalent of ‘$(document).ready()’?
- Changing the selected option of an HTML Select element
- How to export JavaScript array info to csv (on client side)?
- Is it Possible to Extend WP Customize JS Methods?
- What are all the query parameters for getEntityRecords?
- How to prevent text modified using gettext filter being stomped (presumably) by updateText() js function within a CPT’s edit screen
- Load multiple Javascript scripts
- WP script versioning breaks cross-site caching?
- Is there a client side API for handling transients or options?
- Using React.js in WordPress
- How should I add JavaScript to a child theme?
- Custom block SelectControl works but equivalent ComboboxControl gives errors – where’s my mistake?
- Enqueue Javascript After ALL Other Scripts (Including Async Scripts)
- Tinymce.js editor in Chrome?
- How to reference TinyMCE body in my script
- Display a div when post has a certain tag
- Implementing Webflow JS in WordPress
- This page can’t load Google Maps correctly [closed]
- Load images after page load
- How to stop javascript code being broken when going into visual editor
- Facebook fanbox problem
- Add Paypal button redirect to a specific page after completing
- wp-api Backbone JS Client fetch options
- Can I get the user name in JavaScript?
- How to submit form data in the same page in WordPress without reloading the page?
- Custom JS doesn’t work after 4.9.9 update [closed]