Tags:
create new tag
view all tags

Question

Can you combine multiple script actions based on a single event. For example, I want to change a form value in a topic and save the change when a user presses a button. Right now the button runs the edit script and the user then has to do the save. Probably would also like to have it redirect back to the page with the button also, so edit, save and then redirect to original page. Thanks!

Environment

TWiki version: TWikiRelease04x02x03
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2003
Web server: Apache 2.2
Perl version: 5.8.8
Client OS: XP
Web Browser: Firefox
Categories: Permissions

-- TimBacon - 19 Dec 2008

Answer

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.

Use the save script instead of edit script. If it makes sense you ca specify a redirect back to the originating page. More at TWikiScripts.

-- PeterThoeny - 19 Dec 2008

So now i need to have an email get sent also. So now user clicks button, document gets updated and saved, and an email is sent out. Seems I have a nice email plugin to send the mail but I don't understand how to get one button push to do both things? All thoughts appreciated!

-- TimBacon - 21 Jan 2009

Not sure, it looks like you need to take action in a plugin's save topic callback if you want to update a form field and send an e-mail at the same time.

See also MailerContrib, SendEmailPlugin.

-- PeterThoeny - 21 Jan 2009

Looks like someone had already answer this one, I did not see it the first time around: CallingTwoScriptsFromOne

-- TimBacon - 23 Jan 2009

Cool, glad it worked out!

-- PeterThoeny - 23 Jan 2009

Change status to:
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2009-01-23 - PeterThoeny
 
  • 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.