R
R
Roman Govorov2020-04-14 11:25:33
WordPress
Roman Govorov, 2020-04-14 11:25:33

How to cancel sending an application from the site using events, CF7 plugin?

Often, users on a corporate site send several requests at a time. I want to make it so that 1 user can send 1 application, and the second one shows the message "You have already sent an application, expect a call."

There is an event on a click on the submit button for the CF7 plugin, in fact, through which I work.

document.addEventListener( 'wpcf7submit', function( event ) {
 if(event.detail.contactFormId=="32"){ // 32 это id формы для отслеживания
 alert("У формы №32 была нажата кнопка отправить");
 }
}, false );


But I do not understand how to cancel the sending of the message itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2020-04-14
@Asokr

Instead As an option
alert("У формы №32 была нажата кнопка отправить");
event.target.querySelector('кнопка').remove()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question