logo
down
shadow

How to disable submit button and change text on form submit at Wordpress "contact form 7"


How to disable submit button and change text on form submit at Wordpress "contact form 7"

By : user2185501
Date : November 22 2020, 04:01 AM
this will help I am using "contact form 7" WordPress plugin. , Please use this code to disable the submit button.
code :
jQuery('.wpcf7-submit').on('click',function(){
    jQuery(this).prop("disabled",true); // disable button after clicking on button
});
 document.addEventListener( 'wpcf7mailsent', function( event ) {
      jQuery(this).prop("disabled",false);// enable button after getting respone
    }, false );
document.addEventListener( 'wpcf7submit', function( event ) {
    var status = event.detail.status;  
    console.log(status);  
    //if( status === 'validation_failed'){
        jQuery('.wpcf7-submit').val("Send");
    //}    
}, false );

jQuery('.wpcf7-submit').on('click',function(){
    jQuery(this).val("Submitting....");
});


Share : facebook icon twitter icon
simple modal contact form wordpress plugin gives "404 not found" on submit

simple modal contact form wordpress plugin gives "404 not found" on submit


By : Karthikeyan V
Date : March 29 2020, 07:55 AM
may help you . It's because the action is null and it's posting to the wrong page, the plugin is looking for the action here:
code :
$('#smcf-content form').attr('action')
<div id="smcf-container" class="simplemodal-container">
 <div id="modal_content1" class="simplemodal-data">
  <div class='smcf-content'> 
   <form action='/wp-content/plugins/simplemodal-contact-form-smcf/smcf_data.php'>
Submit form only when submit button clicked and prevent "Enter" submitting form

Submit form only when submit button clicked and prevent "Enter" submitting form


By : pietouf
Date : March 29 2020, 07:55 AM
To fix this issue First, keep in mind that what you are attempting breaks UI accessibility standards.
Bearing this in mind, you'll need to stop using a true "submit" button and use a regular button that impersonates the submit button.
code :
$(document).ready(function() {
  $(window).on("keydown", function(event){
    // Check to see if ENTER was pressed and the submit button was active or not
    if(event.keyCode === 13 && event.target === document.getElementById("btnSubmit")) {
      // It was, so submit the form
      document.querySelector("form").submit();

    } else if(event.keyCode === 13 && event.target !== document.getElementById("btnSubmit") ){
      // ENTER was pressed, but not while the submit button was active
       alert("Enter pressed on something other than submit button.");
                
      // Cancel form's submit event
      event.preventDefault();
                
      //  Invoke click event of target so that non-form submit behaviors will work
      event.target.click();
     
      // Tell JQuery to cancel the event
      return false;
    }
  });
        
  // Non-submit button event handling
  $("#btnOther").on("click", function(){
    alert("Other button clicked!");
  });
        
  // Set up your "regular" button to act as a "submit" button when it is clicked
  $("#btnSubmit").on("click", function(){
 	// Submit the form
    document.querySelector("form").submit();     
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form action=# method=post>
  <input name=test>
  <input type=button id="btnOther" value="Other Button">
  <input type=button id="btnSubmit" value=Submit>

</form>
Cannot disable a submit button using jQuery on Contact Form plugin (Wordpress)

Cannot disable a submit button using jQuery on Contact Form plugin (Wordpress)


By : Enes Imsirovic
Date : March 29 2020, 07:55 AM
wish of those help If I run this from the console I see that I get the result you aspect.
code :
$('#submitBtn').prop('disabled', true);
setTimeout(function (){
    $('#submitBtn').prop('disabled', true);
}, 1000);
what to change on php code to submit form with onClick="document.getElementById('form').submit()">SUBMIT<

what to change on php code to submit form with onClick="document.getElementById('form').submit()">SUBMIT<


By : Siraj P
Date : March 29 2020, 07:55 AM
should help you out Two problems with a php mailer : , instead of :
Change Value of Submit Button in WordPress Contact Form 7

Change Value of Submit Button in WordPress Contact Form 7


By : Steven Jeffrey
Date : March 29 2020, 07:55 AM
wish of those help You were very close! Since document.getElementsByClassName("wpcf7-submit") returns an object, you have to use:
code :
document.getElementsByClassName('wpcf7-submit')[0].value = 'MyString';
Related Posts Related Posts :
  • Remove product category placeholder image in Woocommerce
  • I have forgotten my wordpress website admin dashboard url
  • Docker expose service to achieve dockerized wordpress multisite
  • social share icon and text are not refreshing in wordpress (either meta text or text in yeost SEO)
  • WordPress page: Why is <main> tag wrapped by <p> while <div> is not?
  • Adsense Ads not working in Google AMP cache
  • Wordpress images not displaying in pages
  • How to Redirect URL using .access from domain.org/xxx/archive/ to domain.org/archive /wordpress
  • ReCAPTCHA v3 Google Badge is drawn underneath page content
  • Gutenberg dynamic SelectControl values object
  • Clean wordpress spam links
  • Weird date and time formating in Wordpress %Y/%m/%d
  • Image gallery in wordpress
  • Wordpress : display all articles of a month on one page
  • I want to implement TinyMCE in my Wordpress plugin. HOW?
  • how to create new plugin in wordpress?
  • Local host WAMP server is not working?
  • wordpress, category redirect using cookies
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org