Tags:
create new tag
view all tags

Question

I'm doing a formfield search to generate a dropdown list of all the possible value of this field, but where a field value occurs on multiple topics, I'm getting multiple hits returned by the search and therefore it appears multiple times in my dropdown list.

Is there a way to ensure the dropdown only contains a single instance of each value, regardless of how many times it occurs?

Here is the search I'm using:

   <form action="%SCRIPTPATH{view}%/%WEB%/%TOPIC%" method="get">
      <select name="fieldvalue">
         <option>Select fieldvalue...</option>
            %SEARCH{ "[F]ield.*value\=.[A-Z].*" web="Foo" type="regex" nosearch="on" nototal="on" format="<option>$formfield(field)   </option>" order="formfield(field)"}%
      </select>
      <input type="submit" value="Go" />
   </form>

Thanks

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Forms, Search

-- TamsinTweddell - 18 Apr 2008

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

With the SpreadSheetPlugin, you could try putting the search results into a list and then use the LISTUNIQUE function.

-- SeanCMorgan - 22 Apr 2008

Closing this question after more than 30 days of inactivity. Feel free to re-open if needed.

-- PeterThoeny - 03 Jun 2008

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-06-03 - 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.