create new tag
, view all tags

I set up a hidden field in order to force the default value for the UseCategory field to "Yes" when creating a new page. I couldīt find another way to set the UseCategory field to "Yes" as the default here was "No".


If I set this default value to "Yes", both buttons are selected.


I changed line 109 in twiki/bin/edit to

} elsif( ( $scatname eq "UseCategory" ) && ( $src eq "") &&
													 ^^^^^^^^^^^^^^^^ new

TWiki Version: Stable Dec 2000 -- DanielKabs - 23 Feb 2001

This is actually not a bug, and you don't need to make the change in the Perl source. You can save a default topic as you want it, then copy the content to the twiki/templates/Yourweb/notedited.tmpl template (including the category table). Compare also with twiki/templates/Know/notedited.tmpl that is included in the distribution.

-- PeterThoeny - 23 Feb 2001

Reading TWikiCategoryTable I couldīt find the hint you gave above, instead I found:

The default values of the category table can be specified as hidden fields

and following this suggestion (thus leaving notedited.tmpl empty), I added the following code to my page (please try and submit this form):

As you write in the documentation, using HiddenFields one can set e.g. UseCategory to Yes or No.

The original code snippet looks like:

 if( $src =~ /$value[^a-zA-Z0-9\.]/ ) {
					 $flag = "checked";
				} elsif( ( $scatname eq "UseCategory" )  &&
							( ( $i == 3 && $ctext ) || ( $i == 4 && ! $ctext ) ) ) {
					 $flag = "checked";  

This means, depending on $ctext (which contains the html code for the category table, extracted from $text), either of the two buttons will be set. The problem is, the other could be set by $src through HiddenFields.
Iīve done this in the example and thus you end up with both radiobuttons selected.

This is a bug!


See also: CategoryRadioChecking

Cheers-- DanielKabs - 01 Mar 2001
Update -- DanielKabs - 11 Jun 2001

Same with me:

<form action="/twiki/edit/Myweb">
<input type="text" name="topic" value="JustATest" size="32">
<input type="hidden" name="UseCategory" value="Yes">
<input type="hidden" name="GroupIs" value="Test">
<input type="hidden" name="onlywikiname" value="on">
<input type="submit" value="Create topic">
yields both buttons selected. And at least with Netscape 4.7sth. I cannot disable the category - have to save and re-edit the topic override the default yes.

-- PeterKlausner 06 Jun 2001 - 16:13 - r1.4

No fix, the UseCategory radio buttons have been retired in favor of a form to select a template (or none). More at FormTemplateSystem.

-- PeterThoeny - 21 Aug 2001

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2001-08-22 - 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.