I tried to do an ajax form post using the following code but the
resulting request is also a new run of the mill http request not an
ajax one and the options I set in the Request.HTML constructor are
ignored:
...
<form action='save' id='myform'>
<input name='somefield' type='text'/>
<input type='submit' id='sub'/>
</form>
...
<script text='javascript'>
$('sub').addEvent('click',function(e){
new Event(e).stop();
req = new Request.HTML({method:'POST',url:'save'})
req.post($('ad-form'))
}
</script>
the result from this is a non-ajax get request sent to the server and
the response comes back obviously displaying the tiny ajax return
value in full screen.
why is this breaking?
mootools version 1.2.3