Hi all, i search for this but without success.
I need to get the form id, in the file contact-form-7/scripts.js to select a different operation for different form.
How can i get the form id?
Thank you
Ellis
Hi all, i search for this but without success.
I need to get the form id, in the file contact-form-7/scripts.js to select a different operation for different form.
How can i get the form id?
Thank you
Ellis
By looking the HTML source? I'm not sure if I understand what you need.
Hi, you're right, sorry.
I extend CF7 to redirect to paypal for donations.
The problem: i have 2 forms, and now the second redirect too to paypal. This is a problem cause it is only a contact form.
In the scripts.js:
if (1 == data.mailSent) {
ro.addClass('wpcf7-mail-sent-ok');
if (typeof afterFormSubmit == 'function') afterFormSubmit(); //added this
if (data.onSentOk)
$.each(data.onSentOk, function(i, n) { eval(n) });
} else {
then
function afterFormSubmit() {
$("div.wpcf7 > form").unbind('submit.form-plugin');
$("div.wpcf7 > form").attr('action', 'https://www.paypal.com/cgi-bin/webscr');
$("div.wpcf7 > form").submit();
}
I hadn't realize that all the forms took the same behavior :(
I simply think if i get the id of the form, i could change the if statement to call afterFormSubmit(), only for the form i need it.
Thank you
And sorry for my english
How about make a parent <div> with specific id attribute and put [contact-form-7 xxx] shortcode inside it, then use the id of the parent div in your js function?
Hi, i solved ad you said. Sorry but js and php are not in my skills (just a bit).
I add a div with id property to the page. In js, i check the length of the searched div.
It works like a charme.
Thank you
This topic has been closed to new replies.