Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux
Web server: apache
Perl version: 2.8
Client OS:  
Web Browser: mozilla
Categories: Topic revisions, Forms, Missing functionality

-- 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

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2005-08-02 - 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.