[tw] Re: Strange Refresh Behaviour

2011-12-04 Thread skye riquelme
PERFECT...yet again

On 3 dez, 22:30, Eric Shulman  wrote:
> minor correction:
>
> > the  ... has ***NO*** action="..." defined
>
> (and it doesn't need one, anyway)
>
> -e

-- 
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.



[tw] Re: Strange Refresh Behaviour

2011-12-03 Thread Eric Shulman
minor correction:

> the  ... has ***NO*** action="..." defined

(and it doesn't need one, anyway)

-e

-- 
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.



[tw] Re: Strange Refresh Behaviour

2011-12-03 Thread Eric Shulman
On Dec 3, 3:46 pm, skye riquelme  wrote:
> I have a short bit of simple code that  lets me create a new
> tiddler
> 
...
> 
>
> I have used this type of form before and everything works fine. In
> fact this code also works...in that it does create the new
> tiddler.and then RELOADs the pagewhich both annoying and
> totally confusing as to why. Can anyone suggest a cause for this
> behaviour. I note that after the refresh the url reads like -
> file:////Dropbox/directory/Page.html?title=r&text=r&tags=r&fields=r&who=r
> . where these values obviously came from the new tiddler...

The problem is that the  is being *submitted* and has
action="..." defined, so it defaults to loading the current page
again, with the form fields packed into the URL.

Two ways to fix this (both really easy!):

1) Change type="submit" to type="button" (the 'onclick' handler does
all the work, so you don't need form to do any additional 'submit'
handling.

and/or

2) add "return false;" to the end of the onclick handler.  If the
onclick handler returns false, the submit handler is bypassed by the
browser.

that should do it

enjoy,
-e

-- 
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.