Hi -

it seems that yaws_api currently only returns the first match for either queryvar or postvar, and as such doesn't directly support multi value such as the select field.  Just wondering if there are reasons for it?

If not - below is my attempt to contribute :)  The multi-result version returns a tuple so it's easier to check (rather than determining list of lists), but if it's the only value then it still just returns a string.

Cheers,
yc

--- yaws_api.erl    2007-10-23 00:55:33.000000000 -0700
+++ yaws_api.erl    2007-10-23 01:09:59.000000000 -0700
@@ -1641,10 +1641,16 @@
         Val0 ->
             Val0
         end,
-    case lists:keysearch(Key,1,Parse) of
-    {value,{_,undefined}} -> undefined;
-    {value,{_,Val}} -> {ok, Val};
-    false -> undefined
+    case lists:filter(fun(KV) ->
+                  Key =:= element(1, KV)
+              end,
+              Parse) of
+    [] -> undefined;
+    [{_, V}] -> V;
+    Vs -> list_to_tuple(lists:map(fun(KV) ->
+                          element(2, KV)
+                      end,
+                      Vs))
     end.
 
 postvar(ARG, Key) when atom(Key) ->
@@ -1658,10 +1664,16 @@
         Val0 ->
             Val0
         end,
-    case lists:keysearch(Key,1,Parse) of
-    {value, {_,undefined}} -> undefined;
-    {value,{_,Val}} -> {ok, Val};
-    false -> undefined
+    case lists:filter(fun(KV) ->
+                  Key =:= element(1, KV)
+              end,
+              Parse) of
+    [] -> undefined;
+    [{_, V}] -> V;
+    Vs -> list_to_tuple(lists:map(fun(KV) ->
+                          element(2, KV)
+                      end,
+                      Vs))
     end.