I'm trying to post form data using prototype and it's bombing out. I think the root of the problem is that it's not sending the header/content type. Now, I'm still trying to learn how all this works so I might be using the wrong "class". I've done some reading and looked at the prototype.js. The Ajax.Updater inherates the functions from Ajax.Request. It looks like if you specify 'post' it should call a function to include RequestHeaders, but I dont think it's working. Should I use another class?
Code:
<script>
function postBook()
{
var url = 'postdata.asp';
var pars = Form.serialize($('chkbook'));
var myAjax = new Ajax.Updater(
{success: 'placeholder'},
url,
{
method: 'post',
parameters: pars,
onFailure: reportError
})
}
function reportError(request)
{
alert('Sorry. There was an error.');
}
</script>