Question
this may be RTFM, but i am having difficulty understanding how to access values
of input forms variables as TWiki /
TopicVars variables. i have read the
TWikiDocumentation
to no avail.
i am trying to understand how to write code (i guess, a plugin) that would take
the value of a checkbox that might be rendered as a form in twiki page, and then
assign the value to a
TWikiVariable or to a
TopicVarsPlugin variable, so that
it the the variable could be used conditionally (see
ConditionalPlugin).
i'd like to do something similar to the following in a webpage :
%RADIOBUTTONARRAY{numberofbuttons=3,button_labels="L1,L2,L3",returnselection_variable="SELECTED_BUTTON"}
%IF{ %SELECTED_BUTTON% eq "L2" }%
aha, button2 is selected by the user
%ENDIF%
%IF{ %SELECTED_BUTTON% eq "L3" }%
aha, button3 is selected by the user
%ENDIF%
the RADIOBUTTONARRAY plugin would render 3 buttons with the appropriate labels, the user action would cause the variable SELECTED_BUTTON to have the selected value, which in turn could be used as a conditional variable (
ConditionalPlugin) in the text.
(of course also, it would be very nice to have a nested if/else/endif, a C style case statement, and compound conditions for doing this kind of conditional text.)
any suggestions and pointers to appropriate code segments is welcome!
- TWiki version:Revision r1.16 - 24 Nov 2001 - 11:35 GMT
- Perl version:
- Web server & version: Apache2
- Server OS:
- Web browser & version:
- Client OS:
--
PcRustagi - 16 Jan 2003
Answer