JSFiddle - React, Tailwind, and code Playground

by s4ty

HTML

<form method="post" action ="contact.php" target = "popupframe" enctype="multipart/form-data">
    <input type="text" value="Test123"/>
    <input type="text" value=""/>
</form>

JavaScript

var $frame = $("#popupframe");

function submitdo () {
    
    $frame
        .attr('src','html/loading.html') // A loading graphic
        .show('slow');
    
    window.setTimeout(function(){  // The only way I could get the popup to work!
        
        $('form').submit();
            
        //$('form').reset();  // Does not work
        window.setTimeout(function(){  // Used to stop conflict with the captcha
            humanitytest();
        }, 1000);
        
    }, 1000);
    
}  
function resetdo () {  // Called on reset button
    
    humanitytest();
    
    $frame
        .attr('src','html/loading.html')
        .hide('slow');
}

function humanitytest () {
    $("#captchapic").attr('src','images/image.php');
}