Question
I've tried various ways with no success. Is it possible to specify the options for an HTML select where part of the option is a TWiki variable? That is:
<form name="new" action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/">
| *NEW Topic:* | <select name="topic" size="1"> \
%INCLUDE{ActionPlanOptions}%
</select> <br /> Note: This must be a TWiki.WikiWord. |
| | <input type="submit" value=" Create "/ > |
<input type="hidden" name="onlywikiname" value="on" />
<input type="hidden" name="templatetopic" value="FindingsSummaryAndActionPlanTemplate" />
<input type="hidden" name="topicparent" value="%TOPIC%" />
<input type="hidden" name="CreationDate" value="%SERVERTIME{"$day $mon $year"}%" />
<input type="hidden" name="DocumentOwner" value="%WIKINAME%" />
</form>
The topic
ActionPlanOptions is of the following form:
%STARTINCLUDE%<option selected value="">Select...</option> \
<option>%TOPIC%SiteOne</option> \
<option>%TOPIC%SiteTwo</option> \
<option>%TOPIC%SiteThree</option> \
<option>%TOPIC%SiteFour</option> \
<option>%TOPIC%SiteFive</option> \%STOPINCLUDE%
The options, when pulled into the current topic, should then have %TOPIC% expanded to the current TOPIC.
EXAMPLE: The correct result, when pulled into TOPIC
ActionPlanQOne should be:
REALITY: Instead, %TOPIC% is rendered in
ActionPlanOptions and the resulting form is:
I've tried adding as in
%<nop>TOPIC%
but this simply causes the select list to have %TOPIC% as part of the new topic name.
I want to use an include to make it easy to add new items to the list, very similar to how %WEBLLIST% can create dynamic select lists but I would like the selection to be TOPIC-context sensitive. I've created an example at
DynamicHTMLSelectFromInclude just to prove to myself that it is not site (mine) specific.
Environment
--
SteveRJones - 03 Feb 2004
Answer
Won't
%INCLUDINGTOPIC% do the trick? I've modified your
sample application accordingly.
--
FranzJosefSilli - 05 Feb 2004
Yes, and now I feel really stupid. I read that and re-read that description but not until now does it make sense. Thanks!
--
SteveRJones - 06 Feb 2004