[Plugin: Support Tickets] no redirect after submit
-
Hi, all of plugin is runnig, but NO redirection after submit ticket. it’s staying on the from page.
thank’s for help.
Zika
-
Anyone still working on this issue?
This should fix your problem… File support-tickets/scripts.js
jQuery(document).ready(function() {
try {
jQuery(‘div.suptic.form > form’).ajaxForm({
beforeSubmit: supticBeforeSubmit,
dataType: ‘json’,
success: supticProcessJson
});
} catch (e) {
}try {
jQuery(‘div.suptic > form’).each(function(i, n) {
supticToggleSubmit(jQuery(n));
});
} catch (e) {
}
});function supticBeforeSubmit(formData, jqForm, options) {
supticClearResponseOutput();
jQuery(‘img.ajax-loader’, jqForm[0]).css({ visibility: ‘visible’ });formData.push({name: ‘_suptic_is_ajax_call’, value: 1});
jQuery(jqForm[0]).append(‘<input type=”hidden” name=”_suptic_is_ajax_call” value=”1″ />’);return true;
}function supticNotValidTip(into, message) {
jQuery(into).append(‘<span class=”suptic-not-valid-tip”>’ + message + ‘</span>’);
jQuery(‘span.suptic-not-valid-tip’).mouseover(function() {
jQuery(this).fadeOut(‘fast’);
});
jQuery(into).find(‘:input’).mouseover(function() {
jQuery(into).find(‘.suptic-not-valid-tip’).not(‘:hidden’).fadeOut(‘fast’);
});
jQuery(into).find(‘:input’).focus(function() {
jQuery(into).find(‘.suptic-not-valid-tip’).not(‘:hidden’).fadeOut(‘fast’);
});
}function supticProcessJson(data) {
var supticResponseOutput = jQuery(data.into).find(‘div.suptic-response-output’);supticClearResponseOutput();
if (data.redirect) {
supticResponseOutput.addClass(‘suptic-redirecting’);
supticResponseOutput.append(data.message).slideDown(‘fast’);
data.redirect = data.redirect.replace(‘&’, ‘&’);
window.location = data.redirect;
}if (data.invalids) {
jQuery.each(data.invalids, function(i, n) {
supticNotValidTip(jQuery(data.into).find(n.into), n.message);
});
supticResponseOutput.addClass(‘suptic-validation-errors’);
}
if (data.captcha) {
jQuery.each(data.captcha, function(i, n) {
jQuery(data.into).find(‘:input[name=”‘ + i + ‘”]’).clearFields();
jQuery(data.into).find(‘img.suptic-captcha-‘ + i).attr(‘src’, n);
var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
jQuery(data.into).find(‘input:hidden[name=”_suptic_captcha_challenge_’ + i + ‘”]’).attr(‘value’, match[1]);
});
}
if (data.quiz) {
jQuery.each(data.quiz, function(i, n) {
jQuery(data.into).find(‘:input[name=”‘ + i + ‘”]’).clearFields();
jQuery(data.into).find(‘:input[name=”‘ + i + ‘”]’).siblings(‘span.suptic-quiz-label’).text(n[0]);
jQuery(data.into).find(‘input:hidden[name=”_suptic_quiz_answer_’ + i + ‘”]’).attr(‘value’, n[1]);
});
}
if (1 == data.spam) {
supticResponseOutput.addClass(‘suptic-spam-blocked’);
}
if (1 == data.error) {
supticResponseOutput.addClass(‘suptic-form-ng’);
}
supticResponseOutput.append(data.message).slideDown(‘fast’);
}function supticClearResponseOutput() {
jQuery(‘div.suptic-response-output’).hide().empty().removeClass(‘suptic-form-ng suptic-validation-errors suptic-spam-blocked’);
jQuery(‘span.suptic-not-valid-tip’).remove();
//jQuery(‘img.ajax-loader’).css({ visibility: ‘hidden’ });
jQuery(‘img.ajax-loader’, jqForm[0]).css({ visibility: ‘hidden’ });
}// Toggle submit button
function supticToggleSubmit(form) {
var submit = jQuery(form).find(‘input:submit’);
if (! submit.length) return;var acceptances = jQuery(form).find(‘input:checkbox.suptic-acceptance’);
if (! acceptances.length) return;submit.removeAttr(‘disabled’);
acceptances.each(function(i, n) {
n = jQuery(n);
if (n.hasClass(‘suptic-invert’) && n.is(‘:checked’) || ! n.hasClass(‘suptic-invert’) && ! n.is(‘:checked’))
submit.attr(‘disabled’, ‘disabled’);
});
}// Exclusive checkbox
function supticExclusiveCheckbox(elem) {
jQuery(elem.form).find(‘input:checkbox[name=”‘ + elem.name + ‘”]’).not(elem).removeAttr(‘checked’);
}Hi,
It’s work ??
the ajax loader and the green message are not, but the redirection is ok.
Thank s for your help (and sorry for my english!)
ZikaI noticed this… but I thought it was because it process too fast… but I think the loader is not important, since it will redirect to another page… but, if the plugin used AJAX even to load the page, the loader would appear…. To be realistic, this plugin need a total redesign… but I am not the main author… and I am not responsible for this…
PS.: Dont worry with the english, it is also not my native language. ??
Hi Danka,
I am experiencing the same issue – after submitting the form the load icon just continues and the confirmation page does not load.
I’ve copied and pasted this fix code to support-tickets/scripts.js
and now it does not submit at all. The send button does nothing.
Any ideas?
My fix works very well here, by the way, I am not the creator of this plugin… and as I said before, it seems necessary to do a complete redesign in the plugin…
Check what wordpress you are using… here I used the fix to make it work only in WordPress 3.0.1… any other version it would not work.
Yeah. once I went to WP 3.0.4 it stopped working. Very frustrated.
I spent several hours try to figure this problem out.
And then.. clever idea. I’ve removed the Ajax code and it works.
To fix this, open file support-tickets/scripts.js
an delete following lines at the beginning of this file:try { jQuery('div.suptic.form > form').ajaxForm({ beforeSubmit: supticBeforeSubmit, dataType: 'json', success: supticProcessJson }); } catch (e) { }
Save this file, upload back to your webhosting and that’s it.
I’m thinking about forking the WordPress Plugin: Support Tickets. Feedback is needed. https://bit.ly/ePFW17
- The topic ‘[Plugin: Support Tickets] no redirect after submit’ is closed to new replies.