Question
I'm trying to update a
TWikiForms field, via the topic using a custom form. But I only want to update a single TWikiForm field. Right now, I'm using an inline custom form to access the save script directly via the same topic:
<!-- Set calc value for votes to increment
| %FORMVALUE{"Votes"}% |
| %CALC{$SET(Votes, $ABOVE)}% |
-->
<form name="main" action="%SCRIPTURLPATH%/save/QaBig/%TOPIC%" method=post>
<input type="hidden" id="web" name="web" value="%WEB%">
<input type="hidden" id="formtemplate" name="formtemplate" value="!QAToolsSuggestionForm">
<input type="hidden" name="Votes" value="%CALC{$EVAL($GET(Votes) + 1)}%">
<input class="twikiSubmit" type="submit" name="action" id="save" value="Vote"> For This Suggestion.
</form>
QAToolsSuggestionForm looks like so (kinda):
| Vote |
text |
4 |
|
Incrementable counter |
When I click on the button, I want 'Vote' to be incremented (which works), but without updating anything else (or just leaving the contents of the topic alone).
If not, then I have to manually add the contents (including the form) into a hidden textarea, but it's impossible, cause I'd have to recursively add the contents in on themselves... yuck.
any suggestions? I've read a bunch of stuff, but nothing that I can see fits my problem.
thanks.
Environment
--
TWikiGuest - 21 Jun 2005
Answer
Wouldn't the vote functionality of a Plugin do what you want? See
PollPlugin,
VotePlugin,
CommentPlugin. A voting example based on the CommentPlugin is at
TermTemplateIsTooOverloaded.
--
PeterThoeny - 03 Jul 2005