Question
I have a topic where I want to have a 'create new table' button which creates a new table below the button. the user should be able to create a number of these new tables as required. Each new table needs to be EDITTABLE'd.
I've created the following in User Preferences:
%TMPL:DEF{PROMPT:Stable}%<br />
| *Name* | <textarea cols="80" rows="1" name="Stable_name"></textarea> |
| <input type="submit" value="Create new table" /> ||
%TMPL:END%
%TMPL:DEF{OUTPUT:Stable}%
%POS:BOTTOM%
%BR%%BR%
---++ %URLPARAM{"Stable_name"}%
%BR%
%TABLE{ databg="#F3F0F0,#EAEAEA" headerbg="#cccccc" }%
%EDITTABLE{ changerows="off" editbutton="Update table" format="|label|text, 80|" }%
|*TITLE*|%EDITCELL{ "label" }%|
|Data |test data|
%TMPL:END%
I then use COMMENT in the topic itself to allow the user to create multiple tables of the same type on demand:
%COMMENT{ type="Stable" }%
When I run this, the tables are created ok, but the EDITTABLE command seems to get parsed into:
<a name="edittable1"></a>
<form name="edittable1" action="http://x.x.x.x/twiki/bin/viewauth/Sandbox/TestTopic2#edittable1" method="post">
<input type="hidden" name="ettablenr" value="1" />
<input type="hidden" name="etedit" value="on" />
Each created table references 'edittable1' and jumps to the first table in the topic and edits that. Any ideas how to stop this behaviour so the user edits the correct table? Also, how can I stop the EDITTABLE command from being parsed into the html code shown above?
Environment
--
HelenJohnstone - 14 Sep 2005
Answer
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.