Tags:
create new tag
view all tags

SID-02167: Send email and submit form

Status: Answered 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

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Send email and submit form
SupportCategory SendMailPlugin
TWiki version 6.0.1
Server OS CentOS release 6.5, kernel 2.6.32-431.29.2.e16.x86_64
Web server

Perl version 5.10.1
Browser & version

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2016-03-07 - JaniHamalainen
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.