Tags:
create new tag
, view all tags

Question

Hi, How to create a "html select" form with values from a Table ? I Have a table with a single column "name", ( used in twikiforms ):

Name
one
two
three
etc

I want to retrieve values from a search in order to build a select list :

( This is for a topic where a I won't edit/apply a form : it is for some other topic )

Thanks

Environment

TWiki version: TWiki-4.1.2, Sat, 03 Mar 2007, build 13046, Plugin API version 1.11
TWiki plugins: SpreadSheetPlugin,EditTablePlugin,TablePlugin and others
Server OS: linux debian 2.6.18 i686
Web server: apache2
Perl version: v5.8.8
Client OS: any
Web Browser: any
Categories: Forms, Search

-- OlivierThompson - 19 Jun 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

See TWiki.SearchPatternCookbook#Pattern_1_Extract_values_from_a. This topic is also included in your local TWiki web.

-- LynnwoodBrown - 19 Jun 2007

Thank you. This works partilay because I can't get rid of the "*name*" field, since the table have only one column : it's a twikiform with possible values for the form in a separate topic : How can I do a "grep -v Name" in the search ?

-- OlivierThompson - 20 Jun 2007

Can you have your selectbox generated from the same topic as the values that are being pulled to generate the twikiform?

-- MatthewCardozo - 26 Jun 2007

Using the table example on this topic, write this:

<form>
<select>
%SEARCH{ "^\| *[a-z]" topic="%TOPIC%" type="regex" casesensitive="on" multiple="on" nonoise="on" format="<option>$pattern(^\| *([a-z]*) *.*)</option>" }%
</select>
</form>

to get this:

Replace "%TOPIC%" with the name of the option topic.

-- PeterThoeny - 10 Aug 2007

 
Change status to:
Topic revision: r5 - 2007-08-10 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.