> <form method=post target=responseframe action="http://servername/
> mailtext2.php" style="display:inline">
...
>         <input type="submit" value="send"
>                 onclick="var f=this.form;
...
...
> I have two problems
> 1/ it does not create the tiddler in the TW...
> 2/ the mailtext2.php script sends the email, but the values of "when",
> "from" and "tags" and "name" are blank ...I think its the same
> issue....the code that defines these variables is not correct....but I
> cant see why?

When the SUBMIT input button ("send") is pressed, it triggers the FORM
elements action="...", but does not trigger the onclick handler
associated with the button.  To work around this, use an
onsubmit="..." handler in the <form> element, rather than an
onclick="..." handler in the <input type="submit" ...> button.  Thus:

<form method=post target=responseframe style="display:inline"
   action="http://servername/mailtext2.php";
   onsubmit="var f=this;
      var target=f.nextSibling;
      target.style.display='block';
      f.when.value=newDate();
      f.from.value=config.options.txtUserEmail;
      f.name.value=config.options.txtUserName;
      f.extratags.value ='';
      story.forEachTiddler(function(title, tiddler){
         f.extratags.value +='[['+title+']] ';
      });
      config.options.txtTags=f.extratags.value;
      f.tags.value=f.extratags.value+' '+ f.name.value+' comment
temporary';
      store.saveTiddler(f.subj.value,f.subj.value,
            f.msg.value,f.name.value,f.when.value,f.tags.value);
">
...
   <input type="submit" value="send">
...

That should do it.  (Note: untested)

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