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.
, followed by the actual options. The first option is selected by default, e.g. it "remembers" the submitted option because of the URL parameter. The second option is empty to unselect an option, which is useful in a query-by-example form. One disadvantage of this approach is that the selected value is listed twice (in the beginning and in the actual list).
Your approach is more intuitive because it lists options only once. Make sure to escape the IF and URLPARAM with $percnt so that it survives the SEARCH. Escape also double quotes where needed.
Untested format example:
-- PeterThoeny - 21 Dec 2008
Thanks a lot Peter. You have been helpful as ever. It looks like the % in URLPARAM need not (or should not ?) be escaped. Here is what worked.
Just a last question: Is it possible to use the 'value=' parameter in <option> so that I can assign some numerical values to the URLPARAM, based on the dropdown option selected ? In the above mentioned example, I want the URLPARAM{test4} to be assigned values 1,2 or 3 (or any other values like 10,100 or 1000) respectively if A , B or C are selected.
-- ChengappaCB - 21 Dec 2008
Standard HTML:
<option value='100'>A</option>
-- PeterThoeny - 21 Dec 2008
I was actually looking for some way to use this within SEARCH command above. May be I can figure out some way of doing it. Anyway, thanks a lot for all the help.
-- ChengappaCB - 22 Dec 2008
Well... just for the sake of completeness... I solved this by introducing the third column to the table with the values corresponding to the entries in the second column. With a bit of tweaking the $pattern variable, I am able to pick the correct value now.
-- ChengappaCB - 22 Dec 2008
Nice. May be you could summarize it for others as a reference?
-- PeterThoeny - 22 Dec 2008
This is also worth a blog article in the Blog web.
-- PeterThoeny - 22 Dec 2008
I will Peter. I owe one to Twiki
-- ChengappaCB - 26 Dec 2008