<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>FormDataSender :: envie dados de formulário com AJAX, inclusive arquivos.</title>
<script type="text/javascript" src="formdatasender.js"></script>
<script type="text/javascript">
window.addEventListener('load', function(evt){
document.getElementById('test').addEventListener('submit', function(evt){
evt.preventDefault();
var sender = new FormDataSender(document.getElementById('test'), document.getElementById('progress'));
});
});
</script>
</head>
<body>
<form id="test" action="process.php" method="post" enctype="multipart/form-data">
<div>
<progress id="progress" value="0" min="0" max="100"></progress>
</div>
<div>
<label>Text field</label>
<input type="text" name="textfield" value="Sample text">
</div>
<div>
<label>Number field</label>
<input type="number" name="numberfield" value="10">
</div>
<div>
<label>File field</label>
<input type="file" name="filefield">
</div>
<div>
<button type="submit">Send</button>
<button type="reset">Clear</button>
</div>
</form>
</body>
</html>
|