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 <
eris...@gmail.com> 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 <
eris...@gmail.com> 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