I got an answer. We need to grab the code inside the Event Listener code like this:
<script type="text/javascript">
document.addEventListener( 'wpcf7submit', function( event ) {
inputs = event.detail.inputs;
inputs.forEach( function(el) {
if ( el.name == "menu-52" ) {
if ( el.value == "Below $10,000" ) {
location.href = "https://www.facebook.com";
} else if ( el.value == "Above $10,000" ) {
location.href = "https://google.co.in";
}
}
});
}, false );
</script>
Thank you.
Related Posts:
- Contact Form 7 – Give each checkbox a class?
- Conditional fields in contact form 7 not working
- How can I get my Calculate Contact Form 7 field to update with jQuery? [closed]
- Contact Form 7 – Uncaught TypeError: wpcf7.initForm is not a function [closed]
- contact form 7 repeatable fields calculations [closed]
- Use onfocus event in Contact Form 7
- How to add “on change” to a text input in contact form7?
- Close modal window after form submit [closed]
- contact form 7 javascript and wpcf7_before_send_mail action
- Contact form 7 hide and show fields depending up on the condition [closed]
- Securing Contact Form 7 [closed]
- Creating multiline strings in JavaScript
- Babel 6 regeneratorRuntime is not defined
- What is JSONP, and why was it created?
- React – uncaught TypeError: Cannot read property ‘setState’ of undefined
- Cannot read property ‘push’ of undefined when combining arrays
- Add swipe left/right to web page, but use default swipe up/down
- Check if checkbox is checked with jQuery
- What does “res.render” do, and what does the html file look like?
- How to pause javascript code execution for 2 seconds [duplicate]
- Getting Error “Form submission canceled because the form is not connected”
- How to implement navbar using react
- function updateMap for Google Maps API
- Using Node.js require vs. ES6 import/export
- How can jQuery deferred be used?
- Uncaught TypeError : cannot read property ‘replace’ of undefined In Grid
- Disable/enable an input with jQuery?
- npm – EPERM: operation not permitted on Windows
- How to refresh a Page using react-route Link
- ChangeDate – Date Picker Bootstrap
- Is there a sleep function in JavaScript?
- scrollIntoView Scrolls just too far
- Using $setValidity inside a Controller
- Combination of async function + await + setTimeout
- How to go from one page to another page using javascript?
- How to update array value javascript?
- DOMException: Failed to load because no supported source was found
- Simulate Keypress With jQuery
- react router v^4.0.0 Uncaught TypeError: Cannot read property ‘location’ of undefined
- What’s the fastest way to square a number in JavaScript?
- JavaScript: Create and save file
- Adding options to a
- How to use scientific notation in js?
- String.Format not work in TypeScript
- jQuery Ajax POST example with PHP
- How to validate a credit card number
- TypeError: res.status is not a function
- What is define([ , function ]) in JavaScript?
- Array Mapping in AngularJs
- How do I pass the this context to a function?
- HTML5 rich-text inside textarea
- Angular 4 setTimeout() with variable delay and wait
- JSON.parse unexpected token s
- Escaping HTML strings with jQuery
- AngularJS errors: Blocked loading resource from url not allowed by $sceDelegate policy
- How to use z-index in svg elements?
- How do you completely remove Ionic and Cordova installation from mac?
- Uncaught SyntaxError: Unexpected token with JSON.parse
- Why is this simple AngularJS ng-show not working?
- How to open a Bootstrap modal window using jQuery?
- window.location.replace() not working to redirect browser
- “Cross origin requests are only supported for HTTP.” error when loading a local file
- How to destroy a JavaScript object?
- JavaScript single line ‘if’ statement – best syntax, this alternative?
- How can I convert an image into Base64 string using JavaScript?
- Is there a way to create interfaces in ES6 / Node 4?
- wp_enqueue_script : how to change loading order of scripts?
- Is there a core Sortable component in Gutenberg?
- require.js to load javascript
- Is there an equivalent of the PHP function sanitize_key in Gutenberg?
- Add custom form to theme
- Is it mandatory to enqueue any kind of Javsacript?
- Script will not print in head if path to file is correct
- Is there a way to check for an attribute of a script when using script_loader_tag?
- Using webpack to add customizer live preview functionality – wp.customize is not a function
- Path to image in js with wp_localize_script [closed]
- disable tags on wordpress text editor
- Change background image based on the hour [closed]
- is_front_page() variable not found
- Get terms of a taxonomy using useSelect
- What to do about no-global-event-listener warning for “DOM is ready” function?
- How to render WP Rest-API Endpoints in a React.js Theme with Woocommerce
- Getting 404 in the Javascript
- customize-controls.js – extend api.previewer
- Notification when left menu bar is closed?
- Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
- Script Loaded in WordPress but won’t run
- java console error about touch navigation
- When adding google tag script in website, functionality not working
- Update block once an API request returns with a value
- How to improve WP-Rest atrocious response time?
- How should I identify the inline javascript that is the dependent of a wp_enqueue_script?
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- Open image gallery on link click
- WordPress 4.2 mce-views migration guide?
- How To Include JS Script with WP 2023 Theme
- Update js file on wordpress page after making changes
- javscript that updates div in a single wordpress page
- Gutenberg core/file add style support in js/ json
- uploading image to wordpress site with javascript fetch function failed