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
--
TimBacon - 19 Dec 2008
Answer
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