Here I have a normal form like this :
<form id="form" name="form" method="post" action="upload.php"
enctype="multipart/form-data">
<input type="file" size="20" name="handle" id="handle">
<input type='submit' name='submit' id='submit' value='Submit'>
</form>
Of course, it works fine but if I try :
<script type='text/javascript' src='mootools-1.2.js'></script>
<script>
window.addEvent('domready', function() {
$('submit').addEvent(
'click', function(e) {
e = new Event(e).stop();
var jsonRequest = new Request.JSON({onComplete: function(result){
alert(
result.id);
}}).post($('form'));
}
);
});
</script>
<form id="form" name="form" method="post" action="upload.php"
enctype="multipart/form-data">
<input type="file" size="20" name="handle" id="handle">
<input type='submit' name='submit' id='submit' value='Submit'>
</form>
Then nothing happen but a strange message from FireBug :
[Exception... "Component returned failure code: 0x80070057
(NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult:
"0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame ::
javascript: eval(__firebugTemp__); :: anonymous :: line 1" data: no]
And in IE is :
Line: 3626
Char:3
Error: Invalid argument.
Code: 0
Can anybody tell me why please ? I'm really get stuck with it.