Tags:
create new tag
view all tags

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

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