SID-00625: Assign parts of created topic into form field
| Status: |
Answered |
TWiki version: |
4.3.2 |
Perl version: |
5.10.0 |
| Category: |
CategoryForms |
Server OS: |
Fedora 10 |
Last update: |
16 years ago |
I woudl like to assign parts of topic into several fields into a forms that is attached to the created topic.
Example :
Suppose topic is
FirstpartSecondpartThirdpart and form is
| Name |
... |
| Field1 |
... |
| Field2 |
... |
| Field2 |
.... |
When the page is entered I would like to split the topic in three parts and assign them to the fields so i get something that
Field1.value="Firstpart"
Field2.value="Secondpart"
Field3.value="Thirdpart"
and hence the data will show in the form.
--
KlasSehlstedt - 2009-11-15
Discussion and Answer
If you just want to display the values in those field (vs copy actual value) you can place a CALC in that formfield that does a string manipulation on %TOPIC%.
If you want to push the actual values into the fields you need to supply the proper value at the time of topic creation. Use some Javascript in the form where you create new topics. On form submit. push those values into hidden form fields.
A third option is to create a simple form with hidden form fields that updates existing pages with the proper values. That form can use CALC to set the values in the hidden form fields.
--
PeterThoeny - 2009-11-15
Thanks!
Yes that works if one use HTML forms but is this possible to do when one use EDITTABLE and EDITHIDDENTABLE?
The reason for my question is that I'm using a template page with an attached form
I have not complelly understood how to use
TwikiTemplates and TWikiforms togheter with submit to create topic.
--
KlasSehlstedt - 2009-11-15
Study
TWikiTemplates,
TWikiForms,
QuerySearch,
FormattedSearch,
SpreadSheetPlugin.
For inspiration, see working example
SupportForumMaintenance,
AskSupportQuestion,
WebTopicEditTemplate.
--
PeterThoeny - 2009-11-16
Thanks Peter
I did study the
TWikiTemplates and TWikiforms and
have now figured out how to transfer input values from create topic page to the template page with %URLPARAMS% which was one of the problems and That is now solved.
Allthough I now have the problem that %URLPARAM% doesn't get expanded right in the attached form. It does expands correct in the template but noth whitin the attached form, not even if I use %NOP% or %NO%NOP%P%in the formtable.
I have even tried to paste in the %URLPARAM when I attached the form to the template page.
This seems to be similar to the
SID-00403: Expanding %TO%NOP%PIC% in a Form on a Template but it doesn't seem to have the same solution.
--
KlasSehlstedt - 2009-11-17
I does seem that a form attached to a template will not expand %URLPARAM% correctly when creating new topic.
E.g.
<input type="hidden" name="templatetopic" value="DefTemplate" />
With
DefForm attached to
DefTemplate.
A solution to this is have no form attached to
DefTemplate and also using the formtemplate when creting topic. e.g.
<input type="hidden" name="templatetopic" value="DefTemplate" />
<input type="hidden" name="formtemplate" value="DefForm" />
Assign the %URLPARAM% to chosen filed in the vaalue fieldin th form.
--
KlasSehlstedt - 2009-11-17
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.