This question about Using an extension: Asked

FormPlugin example using CommentPlugin to fill a table - not working?


Hi, the example on the FormPlugin page using the CommentPlugin to fill a table doesn't seem to work. I would be forever in someone's debt if they could post a working version. It's here: http://foswiki.org/Sandbox/FormPluginExamples and reproduced below.

Cheers.

This form uses System.CommentPlugin to write submitted values to a table. A user-friendly display of table data is not included in the example.


%STARTFORM{
name="new_article_prependtotable"
action="save"
topic="Support.Question1572"
anchor="NewArticles"
validate="on"
onsubmit="return (foswiki.Form.makeSafeForTableEntry) ? foswiki.Form.makeSafeForTableEntry(this) : true;"
strictverification="off"
}%
<!-- <nop>CommentPlugin attributes -->
<input type="hidden" name="comment_action" value="save" />
<input type="hidden" name="comment_type" value="new_article_prependtotable" />
<input type="hidden" name="comment_templatetopic" value="Support.Question1572" />
<input type="hidden" name="comment_location" value="<!--InsertPoint-->" />
<div>
<div>
---++!! Enter a new article

Attach a file first, then enter the data below.
</div><div>
%FORMELEMENT{
type="text"
name="title"
title="Title"
hint="Link will have this label"
validate="nonempty"
mandatory="on"
}%
%FORMELEMENT{
type="text"
name="source"
title="Source name"
}%
%FORMELEMENT{
type="text"
name="source_url"
title="Source url"
}%
%FORMELEMENT{
type="date"
name="date"
default="11 Jan 2018"
title="Publishing date"
}%
%FORMELEMENT{
type="hidden"
name="entry_date"
default="11 Jan 2018"
}%
</div><div>
%FORMELEMENT{
name="action"
type="submit"
buttonlabel="Save"
}%
</div>
</div>
%ENDFORM%


---++!! Article data


| Title | Source name | Source url | Publishing date | Entry date |
<!--InsertPoint-->


<verbatim style="display:none;">
%TMPL:DEF{OUTPUT:new_article_prependtotable}%%POS:BEFORE%| | | | | |
%TMPL:END%
</verbatim>

-- SmCmpbll - 27 Mar 2015
Can you tell us more about how your example "doesn't seem to work"? Was the form not properly displayed, or was the output wrong? That may help identify the source of the problem being with FormPlugin or CommentPlugin.

I recently updated a site that made fairly extensive use of FormPlugin and I ended up recreating the forms because they were broken with the newer version of Foswiki. The issue in this particular case may have been the known bug that FormPlugin doesn't work with FCGID, however this plugin hasn't been updated for several years and I noticed several un-addressed bugs so I wasn't very confident about it. Although it may not exactly help your use case since you aren't working with an existing DataForms definition (although you could create one), I find FlexFormPlugin better to work with than FormPlugin anyways. Otherwise, you might have better luck just using a simple html form combined with CommentPlugin (using examples provide with that plugin).

-- LynnwoodBrown - 07 Apr 2015

QuestionForm edit

Subject Using an extension
Extension FormPlugin, CommentPlugin
Version Foswiki 1.1.9
Status Asked
Related Topics
Topic revision: r2 - 07 Apr 2015, LynnwoodBrown - This page was cached on 11 Jan 2018 - 04:07.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License