I have set up a webform for simple user polling with an yes/no option, with a submit button.

  [ ] Yes
  [ ] No


and the parameter is pass via URL as default, e.g.:


Currently, the webform link is sent via email. So users click the link, open a browser, select an option or use the default, press submit, and see the confirmation message.

Is it possible to automate the submit click? Such that the submit button is automatically clicked after clicking on the link in email?

  • It is easy if you know how to write module. Are you expecting to have a solution with contrib modules?
    – Jimmy Ko
    Commented Jul 12, 2016 at 10:35
  • As long as it works with the webform module, please explain how to do that with a module...
    – ohho
    Commented Jul 13, 2016 at 2:46

1 Answer 1


Inject some javascript into the body using PHP can make auto submit to work by a param in URL:


For example, the webform node ID is 101:

<?php if ($_REQUEST['autosubmit']) { ?>

    (function ($) {     

<? } ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.