SID-02167: Send email and submit form
| Status: |
Answered |
TWiki version: |
6.0.1 |
Perl version: |
5.10.1 |
| Category: |
SendMailPlugin |
Server OS: |
CentOS release 6.5, kernel 2.6.32-431.29.2.e16.x86_64 |
Last update: |
9 years ago |
What I'm trying to achieve is to give a user that is filling out an HTML form, the option of notifying someone by email, that the form content has been updated. I'm hoping that this could be achieved in a single "Submit".
I've looked at the example in
SendMailPluginRestDemo and copied the content HTML form and script to my own TWiki. I changed the <form> within the example to:
<form enctype="multipart/form-data" action="/do/save/%WEB%/%TOPIC%" method="post"> to allow the form content in the topic to be updated.
With this change it seems that everything works (email is sent successfully) but the form content is not updated.
I'm assuming that when the email is sent the script does not continue with the /do/save/%WEB%/%TOPIC% action however I'm unsure how that could be implemented or if it's possible. Any help or insight would be appreciated.
--
Jani Hamalainen - 2016-03-05
Discussion and Answer
Do you want to update an existing topic or create a new one? If the latter see
SendMailPlugin
--
Peter Thoeny - 2016-03-06
BTW, the scenario you describe should work if you remove
event.preventDefault(); from the submit event callback.
--
Peter Thoeny - 2016-03-06
Thanks Peter! Removing
event.preventDefault(); accomplishes exactly what I was hoping to do.
--
Jani Hamalainen - 2016-03-07
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.