Contact Form 7 Conditional redirect

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 == … Read more

Access checks with custom REST endpoints and backbone

The issue was I overrode the Backbone.sync method only in Backbone.Model. When Backbone fetches the initial data (GET) it is using the sync method in Backbone.collections. So I need to override the sync in Backbone.Collections: app.Collection = Backbone.Collection.extend({ sync: function( method, model, options ){ return Backbone.sync(method, this, jQuery.extend( options, { beforeSend: function (xhr) { xhr.setRequestHeader( … Read more

Replace script attr or link

Much like all programming, there are many ways to go about solving this. One way is using an id tag id = “script_lionlaw” (or name is whatever you want) within the script. <script type=”text/javascript” src=”https://thompsonlaw.formstack.com/forms/js.php/tho_lionlaw_com_v2″ id = “script_lionlaw”></script> You could then use jquery (or some other means) to grab the tag and then replace it … Read more

How to show cities according to the state in Form using Javascript? [closed]

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 … Read more