Hello  Måns,

I'm not sure if I understand your sorting issue. I think that may be a
topic for a different thread.

But for your fields, you need to change this string in the code:

var fmt='|%0|%1|\n%2\n';

to format and place your fields. As written, this will only show the
first 3 of your fields. You need to add field placement id's (e.g. %0,
%1) for each place where your want your field to show up in the
resulting text. Maybe something like:

var fmt='|%0|%1|%2|%3|%4|%5|%6|%7|%8|%9|%10|\n%11\n';

-- Mark

On Feb 8, 2:25 pm, Måns <[email protected]> wrote:
> Hi Mark and Eric
>
> I've been trying to change the code in CreateTiddlersFromForms to
> produce a sortable table for my specific needs.
> I know that I'm far out of my league trying to change html-code - as I
> am a total newbie in writing html.
>
> As You can see in my thread:"Getting macros into a form or a
> predefined tiddler" I've been trying to solve the same issue in
> several differnt ways..
>
> What I want it to produce is something like this (in tw-format):
> Title=Date
> text: !!Fredagssangtimen
> <<toggletag Sang>> <<toggletag SangArkiv>>
> |sortable|k
> |Nr|Titel|Mappe|Side|Ny|Piano|h
> |1|field1list from a tiddler|field2<<checkbox>>|field3(Side)|
> field4<<checkbox>>|field5list from a tiddler|
> |2||||||
> |3||||||
> |4||||||
> |5||||||
> |6||||||
> |7||||||
> |8||||||
> |9||||||
> |10||||||
> |11||||||
> |12||||||
> |13||||||
> |14||||||
> textfield:Comments:
>
> I've tried to change some values - but it's "in the dark"....
>
> Here whats I've been doing with CreateTiddlersFromForms (it doesn't
> work at all - and is not any way near what I'm trying to accomplish):
> Maybe You can see where I'm doing something wrong...
>
> /%
> |Beskrivelse|Lav sangtimetabellen i en Html-formular|
> %/
> {{small{
> __Lav sangtimetabellen i en Html-formular__
>
> The following HTML demonstrates a technique for using an HTML form,
> rendered in a tiddler, to input and create tiddlers with custom-
> formatted content
> !!!!Try it:
> {{smallform{
> <html><hide linebreaks><!-- see HTMLFormattingPlugin --><form
> action="javascript:;"
>         onsubmit="
>                 /* validate new title */
>                 var t=this.title.value;
>                 if (!t.length || t==this.title.defaultValue)
>                         { alert('A title is required'); this.title.focus(); 
> return false; }
>                 if (store.tiddlerExists(t) && !confirm
> (config.messages.overwriteWarning.format([t])))
>                         { this.title.focus(); return false; }
>
>                 /* get current tiddler (if any) */
>                 var tid=store.getTiddler(t);
>                 var who=tid?tid.modifier:config.options.txtUserName;
>                 var when=tid?tid.modified:new Date();
>                 var txt=tid?tid.text:'';
>                 var tags=tid?tid.tags:[];
>                 var fields=tid?tid.fields:{};
>
>                 /* get form values and construct new tiddler text */
>                 var fmt='|%0|%1|\n%2\n';
>                 var newtxt=fmt.format
> ([this.field1.value,this.field2.value,this.field3.value,this.field4.value,this.field5.value,this.field6.value,this.field7.value,this.field8.value,this.field9.value,this.field10.value,this.field11.value,this.field12.value]);
>
>                 /* insert new text at marker (or end, if no marker) */
>                 var marker='/%MARKER%/';
>                 if (txt.indexOf(marker)==-1) txt=txt+newtxt;
>                 else txt=txt.replace(new RegExp(marker.escapeRegExp()),newtxt
> +marker);
>
>                 /* get new tags and add to existing tags (if any) */
>                 var newtags=this.tagsfield.value.readBracketedList();
>                 for (var i=0; i<newtags.length; i++) 
> tags.pushUnique(newtags[i]);
>
>                 /* write and show tiddler */
>                 store.saveTiddler(t,t,txt, who, when, tags, fields);
>                 story.displayTiddler(story.findContainingTiddler(this),t);
>                 return false;">
> Title <input name="title" value="Skriv dato" onfocus="this.select()">
> Sang1 <input name="field1" value="sortable|k\n" onfocus="this.select
> ()">
> Sang2 <input name="field2" value="Sang1 value" onfocus="this.select
> ()">
> Sang3 <input name="field3" value="Sang2 value" onfocus="this.select
> ()">
> Sang4 <input name="field4" value="Sang3 value" onfocus="this.select
> ()">
> Sang5 <input name="field5" value="Sang4 value" onfocus="this.select
> ()">
> Sang6 <input name="field6" value="Sang5 value" onfocus="this.select
> ()">
> Sang7 <input name="field7" value="Sang6 value" onfocus="this.select
> ()">
> Sang8 <input name="field8" value="Sang7 value" onfocus="this.select
> ()">
> Sang9 <input name="field9" value="Sang8 value" onfocus="this.select
> ()">
> Sang10 <input name="field10" value="Sang9 value" onfocus="this.select
> ()">
> Sang11 <input name="field11" value="Sang10 value" onfocus="this.select
> ()">
> Sang12 <input name="field12" value="Sang11 value" onfocus="this.select
> ()"><br>
> <textarea name="Kommentarer" rows=5 style="width:100%;">Kommentarer
> skrives her</textarea><br>
> <input name="tagsfield" value="Sang" style="width:100%;"><br>
> <input type="submit" value="create tiddler">
> </form></html>
>
> }}}
> }}}
>
> On 8 Feb., 21:19, Eric Shulman <[email protected]> wrote:
>
> > > What I would like is a tiddler macro that might work like this: You
> > > set up a form in a tiddler.
> > >...
> > > When you submit, the data from the form would be collected, formatted
> > > (printf style), and inserted into the top or bottom of the specified
> > > tiddler.
>
> > This should help:
>
> >http://www.tiddlytools.com/faq.html#FAQ_CreateTiddlersFromForms
>
> > enjoy,
> > -e
> > Eric Shulman
> > TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to