Hi, I have been using this simple html-form to create a new tiddler. Now 
when I start using TW 2.7 I notised the username did not get saved. Has 
anything changed that can influence?
Thanks for any answer
/Magnus
 
<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\n' ;
 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);

 /* 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);
 story.closeAllTiddlers();
 saveChanges();
 return false;">
Vänligen skriv in Ditt <b>för- och efternamn</b> (ex. Tian Tiansson)
<input name="userName" style="width:50%;" value="" 
onfocus="this.select()"><br>
Tänk på att ge varje inlägg ha en unik <b>rubrik</b>, i annat fall kommer 
det nya inlägget skriva över det äldre<br>
<input name="title" style="width:50%;" value=""><br>
skriv <b>texten</b> till inlägget<br>
<textarea name="field1" rows=5 style="width:100%;"></textarea><br>
<input name="tagsfield" type=hidden value="information"><input 
type="submit" value="spara inlägg">
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to