Hi All Again still struggling a bit with this code.....
the suggestion from colmjude does indeed create the new tiddler...but it only passes the values of subj,msg and to....to the php file....or at least the php file only prints them out....the other values calculated by the onclick handler dont show up in the email created by the php file..... ...so I tried Erics suggestion....and got the code to be ... <html> <form method=post target=responseframe style="display:inline" action="http://server/mailtext2.php" onsubmit= "var f=this.form; var target=this.form.nextSibling; target.style.display='block'; f.when=new Date(); f.from=config.options.txtUserName+'( '+config.options.txtUserEmail +' )'; f.name=config.options.txtUserName; f.extratags =''; story.forEachTiddler(function(title, tiddler){f.extratags += '[['+title +']] ';}); f.tags=f.extratags+' '+ f.name+' comment temporary'; store.saveTiddler(f.subj.value,f.subj.value,f.msg.value,f.name,f.when,f.tags); "> <input type='hidden' name='to' value="my email"> <input type='hidden' name='from' value='sssskye'> <input type='text' name='subj' style="width:50%" onfocus="this.select()" value="titulo seu comentario"><font size=-2>Seu Comentario:</font><br> <textarea rows=7 cols=50 name='msg' style="width:99%" onfocus="this.select()"></textarea><br> <div style="text-align:center"> <font size=-2>Enter your information, then press</font> <input type="submit" value="send"> </div> </form><div class="fine" style="text-align:center;display:none"> server response:<br> <iframe src=........ this code does not generate a new tiddler and does not pass the computed values to the php file (note that the resulting email now showes from=sssskye....showing that the php file is reading the form values and not the onclick computed values....... HELP!!! The php file starts of with .... $errmsg = ''; $sys = $_SERVER['SERVER_NAME']; $sys=str_replace("www.","",$sys); $id = $_SERVER['REMOTE_ADDR']; if ($_SERVER['REMOTE_HOST']!='') $id.=' '.$_SERVER['REMOTE_HOST']; $tags = $_REQUEST['tags']; $subj = $_REQUEST['subj']; $msg = $_REQUEST['msg']; $from = $_REQUEST['from']; $to = $_REQUEST['to']; $createdby = $_REQUEST['name']; $created= $_REQUEST['when']; if ($to=='') { $errmsg = "A destination address is required.<br>"; } else if (!stristr($to,$sys)) { $errmsg = "Invalid destination: ".$to."<br>Domain must be: ". $sys."<br>"; } ...how can I get it to use the onclick values and not the form values ? Thanks again Skye PS tobias...I am not sure exactly where to put the onclick wrapper you mentioned.....@! On 8 Out, 00:22, Eric Shulman <elsdes...@gmail.com> wrote: > > <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 tiddlyw...@googlegroups.com. To unsubscribe from this group, send email to tiddlywiki+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.