So good so far !

<html><hide linebreaks><!-- see HTMLFormattingPlugin --><form
action="javascript:;"
        onsubmit="
                /* validate new title */
                var t=story.findContainingTiddler(this).getAttribute('tiddler');

                /* 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();0
                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='\n*%0';
                var newtxt=fmt.format([this.field1.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);

                /* write and show tiddler */
                store.saveTiddler(t,t,txt, who, when, tags, fields);
                story.displayTiddler(story.findContainingTiddler(this),t);
                return false;">
<input name="field1" value="QuickTask Here" onfocus="this.select()"
style="width:50%">
<input type="submit" value="+">
</form></html>

Reference:
http://www.tiddlytools.com/#FAQ_CreateTiddlersFromForms

Mike

On Apr 21, 5:03 pm, Mike <[email protected]> wrote:
> My Example form:
>
> <html><nowiki><form class="quickNote" style="display:inline;margin:
> 0;padding:0;white-space:nowrap;">
> <input type=text name="txt" style="width:50%">
> <input type=button value="save" style="width:8%" onclick="
>         var who=config.options.txtUserName;
>         var when=new Date();
>         var tags=story.findContainingTiddler(this).getAttribute('tags');
>         var title=story.findContainingTiddler(this).getAttribute('tiddler');
>         var text=tiddler.text+this.form.txt.value;
>         store.saveTiddler(title,title,text,who,when,tags,{});
>         story.displayTiddler(null,title);
> "></form></html>
>
> Reference:http://www.TiddlyTools.com/#QuickNote
>
> Mike
>
> On Apr 21, 2:23 pm, Mike <[email protected]> wrote:
>
>
>
> > Quick question concerning the output of the form
> > In QuickNote the following line is used
> > var text=this.form.txt.value;
> > Which if used when adding to the containing tiddler replaces the
> > content of that tiddler
> > So I used
> > var text=tiddler.text+this.form.txt.value;
> > Which adds the text from the form directly after the macro
> > I.E. <<tiddler transclusion>>text from form
>
> > I would like to add this text to a new line as a list
> > I.E.
> > <<tiddler transclusion>>
> > *text from form
>
> > I tried a few variants of
> > var text=tiddler.text+"/n*"+this.form.txt.value;
> > and I tried breaking it up into different variables and stitching it
> > back together. . .
>
> > I am sure I am missing something simple (syntax?)
>
> > Thank You !
>
> > Mike
>
> > On Apr 18, 12:36 pm, Mike <[email protected]> wrote:
>
> > > Thank you for the feedback / example,
> > > I think I have a good starting point now.
>
> > > Mike
>
> > > On Apr 18, 4:55 am, Eric Shulman <[email protected]> wrote:
>
> > > > > How would I change the output to the containing tiddler vs a new
> > > > > tiddler?
>
> > > > To get the title of the containing tiddler (using HTML <a> element):
> > > >    var t=story.findContainingTiddler(this).getAttribute('tiddler');
>
> > > > To get the title of the containing tiddler (using eval params or
> > > > inline script):
> > > >    var t=story.findContainingTiddler(place).getAttribute('tiddler');
>
> > > > Then, use it the same as before:
> > > >    var tid=store.getTiddler(t);
> > > >    ...etc...
>
> > > > enjoy,
> > > > -e
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "TiddlyWikiDev" 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 
> > > > athttp://groups.google.com/group/tiddlywikidev?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "TiddlyWikiDev" 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 
> > > athttp://groups.google.com/group/tiddlywikidev?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "TiddlyWikiDev" 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 
> > athttp://groups.google.com/group/tiddlywikidev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWikiDev" 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 
> athttp://groups.google.com/group/tiddlywikidev?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" 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/tiddlywikidev?hl=en.

Reply via email to