Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <form id="upload_form" method="post">
    <input type="submit" value="Upload" />
    
  </form>  
</body>
</html>
 
form = document.getElementById("upload_form");
size=0;
form.onsubmit = delayedSubmit;
function delayedSubmit () {
    if (++size < 5) {
        alert('Counting ' + size);    
        setTimeout(delayedSubmit,100);
        return false;
    } 
    alert("Form submitted");
    form.submit();
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers