Im really not understanding somthing with Prorotype, what I want to do
is call a piece of php that accepts a file from a form, process it and
return a very simple true/false. Now Ive been playing with it inside
of a form element and so far have this.
<script type="text/javascript">
function addImage( form ) {
var success = function(t) {
alert( 'woohoo' );
}
new Ajax.Request( 'addImage.php', {
method: 'post',
asyncronous: false,
contentType: 'multipart/form-data',
postBody: Form.serialize( form ),
onComplete: success,
// Handle 404
on404: function(t) {
alert('Error 404: location "' + t.statusText + '"
was not found.');
},
// Handle other errors
onFailure: function(t) {
alert('Error ' + t.status + ' -- ' +
t.statusText);
}
} );
}
</script>
<form id='test' enctype="multipart/form-data" action=''
method='post' onsubmit="addImage( 'test' ); return false;">
<input type="file" name="file" id="file"/>
<input type="submit"/>
</form>
The script seams to suceed, not nothing ever reaches the PHP, what am
I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---