Tags:
create new tag
view all tags

Question

I tried scouring the other support topics on forms but was unable to find an exact answer on how to do this. ( Then again, I can never find the ketchup in the fridge, so.. )

I've created a simple form to allow the 'approval' of documents, basically giving each document a status. The only part I'm having trouble with is that I have a field for 'approved by'.

I'd like to make this field a text field that defaults to the TWiki username of the user submitting the form. I'd also like to disable the field so that it cannot be changed.

I tried to edit the WebTopicEditTemplate for the web and I inserted % WIKIUSERNAME% into the default value.

This runs into two issues though. When I add the form to an existing topic, it does not come up at all. No text is entered into the field. The second is that when I create a new topic, instead of the actual username, it brings up % WIKIUSERNAME%. This would be fine if it actually stored the username, but it actually stores % WIKIUSERNAME% as the value, and whenever someone views the page, it looks as if they were the ones who approved it.

I also could not find anything on disabling a form field.

Any help would be appreciated.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, SpreadSheetPlugin, CommentPlugin, EditTablePlugin, TablePlugin, RenderListPlugin
Server OS: Redhat ES AS 3.0, Update 2, kernel 2.4.21-15.ELsmp
Web server: Apache 1.3.33
Perl version: 5.6.1
Client OS: Win2k, sp2
Web Browser: IE 6.0
Categories: Forms, Missing functionality

-- StevenHajducko - 02 Jun 2005

Answer

Other useful topics concerning stuff like this are HandleCommonTagsInFormDef, FormValuesFromSearch, TWikiFormsDontExpandVariables. However, none of them are explaining it well enough for my neophyte self.

-- StevenHajducko - 02 Jun 2005

Is there anyway to use the WebTopicEditTemplate as an override for some form values, but not all?

In other words, if using the FormsAddOn, if you create a form with default values in the form definition, and then specify the form in the edit template, how can you make it so that certain form values are overwritten and some aren't? At the moment, blank values in the WebTopicEditTemplate override values specified in the form definition.

-- StevenHajducko - 03 Jun 2005

You should be able to create a TWikiForms with an "Approval" field of type "label" and attach that to your WebTopicEditTemplate.

You should be able to initialize the field with %WIKIUSERNAME% although I have not tried that. Alternatively, use an HTML form to create a new topic (as in the MeetingMinutes example) with a hidden input field named "Approval" and value "%WIKIUSERNAME%".

-- PeterThoeny - 03 Jul 2005

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