We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Hello, using FormIt I have a form that is processing and sending quite a lot of data and sometimes it takes few seconds to do it.
    Is there a way to trigger any DIV or any animation while is sending? so the client will know that is in process.

    Thank you!
      --
      ysanmiguel.com
      • 17301
      • 932 Posts
      yeah just add a fixed position div overlay with your animation in and then assign an id to your submit button and use javascript/jquery to fade in the div. Assuming you're redirecting after submission you also don't need to worry about hiding it again on success smiley

      $('#submit-btn').click(function(event) {
      	$('#loading-div').fadeIn();
      });
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 33238
        • 388 Posts
        Good, but what happen in case the client click on submit and there is an error, the event $('#loading-div').fadeIn(); is going to trigger anyway.

        I was thinking something like a hook before sending or something like that?

        thanks LK
          --
          ysanmiguel.com
          • 17301
          • 932 Posts
          Setup your form validation in javascript also and if validated then launch the div smiley
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 17301
            • 932 Posts
            You may be able to do a prehook to echo out a div, but it would be a lot faster to do your front-end validation and other fe requests as front-end developments.
              ■ email: [email protected] | ■ website: https://alienbuild.uk

              The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.