Hi all,
I'm having problem with the upload form and I don't understan where
I'm in error, I'm trying to reproduce the example of Mike Alsup.
I explain what I've done
file index.html
<html>
<head>
<title>Title</title>
<script type="text/javascript" src="js/jquery-latest.pack.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// I don't undestand what exactly I must put here
$('#uploadForm').ajaxForm({
beforeSubmit: function(a,f,o) { // "o" is not necessary for me right?
// "a" and "f" ?
o.dataType = $('#uploadResponseType')[0].value; // I've removed
tihs div is here the error? I don't need this
$('#uploadOutput').html('Submitting...');
},
success: function(data) {
var $out = $('#uploadOutput');
$out.html('Form success handler received: <strong>' + typeof data +
'</strong>');
if (typeof data == 'object' && data.nodeType)
data = elementToString(data.documentElement, true);
else if (typeof data == 'object')
data = objToString(data);
$out.append('<div><pre>'+ data +'</pre></div>');
}
});
});
// I think this is necessary
function objToString(o) {
}
// Also this
function elementToString(n, useRefs) {
}
// I'm missing something else?
</script>
</head>
<body>
<form id="uploadForm" action="upload.php" method="POST"
enctype="multipart/form-data">
File: <input name="file" type="file">
<input type="submit" value="Invia">
</form>
<div id="uploadOutput"></div>
</body>
</html>
--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it." -- Alan Kay