I want to submit a form in ajax mode & using post method so that i don't need to build the query string. Is there any way to do this? Thanks
i posted something like that in my blog last week: http://fragged.org/getting-fancy-with-ajax-your-first-form-submission-and-verification_460.html
Might want to read about using ajax in the onsubmit event: http://www.alistapart.com/articles/userproofingajax Also, a small comment, the "level" of javascript at the sitepoint javascript forum is considerably higher then here, some pretty good experts over there.
oh. just like that... I had a cursory look but since you are not elaborating on the _why_ i may want to be reading it, i failed to discover anything of significance that i did not know already. (p.s. the context of my post is to help people kickstart their first attempt at getting some form processing and an ajax request working, not user proofing the actual xhttp process. naturally, the Request class in mootools supports the whole methodology like onProgress, onFailure, timeouts and so forth - i just do not consider these to be of the kind of things one pulls off on a first date, that's all) (p.p.s, wonder if I will ever be good enough to open a SP account, eek! i have 3 feed readers, you know)
Yeah, i thought for some reason that you couldn't use ajax in onsubmit at all but it seems like you can but just cant use ajax and use the onsubmit, you have to use one or the other (which makes sense in a way).
well yes, its either one or the other - naturally. in a semantic setup where your form is submitting to a form processor and works independently of any clientside settings, the ajax layer would come 'on top' of the form's onsubmit method, effectively highjacking it. it needs to intercept the event AND kill it lest the form submits and the url changes in the middle of your field processing. in that sense, yes, once the event's default action is dead, you can do the ajax call at your own leisure. can't really think of an alternative to the above other than building an ajax call out of elements that are not a part of a form and building a custom trigger event around a submit button--then yes, there won't be a onsubmit but it won't be very accessible etc.