Il 21/11/2012 21:43, skye riquelme ha scritto:
Hi All

I have been using localStorage extensively in my TW work, but cant
seem to get access to the data from within html forms....for
eample...why doesnt this simple bit of code set the localStorage item
"test"?? (the wikify at the end is just to check if test got set.)


Try this snippet, it should work:

<html>
<form name="myform" action="" method="GET">Enter something in the box:
<BR>
<INPUT TYPE="text" NAME="inputbox" VALUE="">
<INPUT TYPE="button" NAME="button" Value="Click"
onClick="testResults(this.form)">
</form>
</html><script>
testResults= function(form) {
   var TestVar = form.inputbox.value;
   var test=localStorage.setItem("test",TestVar);

   wikify("localStorage key test = "+
           localStorage.getItem("test")+"\n",place );
}
</script>



regards
--
tiziano de togni
______________________________________
http://tizziano.altervista.org/

--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlywiki@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.

Reply via email to