Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease02Sep2004
TWiki plugins:  
Server OS:  
Web server:  
Perl version:  
Client OS: XP
Web Browser: Firefox 1.0.6
Categories: Plugins

-- HelenJohnstone - 14 Sep 2005

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.

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2005-11-01 - 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.