I need some help completing my ajax/eform idea I have been working on the last 24 hours... I may of not done things the most graceful way but it’s working so far.
Basically I use eform to structure a form and use the verification code, i then wrote a snippet to validate the fields and returns if the user input things correctly or not without refreshing the page. Now I need to redirect the user after they have successfully filled in the fields but everything I have tried seems to fail.
I tried
$modx->sendRedirect($modx->makeUrl($modx->config[’site_start’]));
but this only redirects the area where the ajax div appears when validating the form so it renders the site again within the page. How can I make the redirect work that once the user reaches a certain part of the php that they are redirected to a thank you page.
I’m using Mootools for the ajax side.
window.addEvent('domready', function(){
$('newJob').addEvent('submit', function(e) {
new Event(e).stop();
var log = $('log_res').empty().addClass('ajax-loading');
this.send({
update: log,
onComplete: function() {
log.removeClass('ajax-loading');
}
});
});
});
Everything works great but I would prefer a redirect after the form is completed.