I am quite new to all of this and have a form that emails the contents on submit, it is taking a little while for it to process so the user is clicking multiple times and sending more than one copy of the email. Is there any way to prevent this from happening?
Hi gfaulkner,
You can add a JavaScript snippet to disable the submit button. Assuming that it has an id of 'submit' it will be something like this:
However, it's pretty unusual for sending emails to cause any significant delay in the form submitting so you might want to check some more to see what is happening.
Bob
You can add a JavaScript snippet to disable the submit button. Assuming that it has an id of 'submit' it will be something like this:
<?php
$script = "
window.addEvent('domready', function() {
$('submit').addEvent('click', function() {
$('submit').disable = true;
});
});
";
$doc = & JFactory::getDocument();
$doc->addScriptDeclaration($script);
?>
NB - this goes in the Form HTML box.However, it's pretty unusual for sending emails to cause any significant delay in the form submitting so you might want to check some more to see what is happening.
Bob
This topic is locked and no more replies can be posted.