I think the javascript function is "onBlur()" This would hook into a
function with a five second timer which would then submit the form.
My concern with this would be looking at it from the user side. It
might be cool to do this programming wise, but would it confuse the
user? I''m not sure if I would like it if I were _using_ a form like
this.
Good Luck!
Josh
On 8/22/05, Julian Leviston
<julian-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org>
wrote:> Hi Rails peoples,
>
> I thought I''d posted this earlier, but it didn''t seem to
have gone
> and my email was lost - so here it is again.
>
> I''m trying to create a page which lets me edit a set of
configuration
> text files via a webserver. What I''ve got so far is a page which
> displays the text files as link_to_remote hyperlinks in
<div>''s, each
> of which respectively replaces the corresponding div with a text area
> and a form and two buttons - cancel (revert) and save (submit).
>
> That''s fine, however I''d like something similar to this
functionality
> in terms of updating: http://www.ajaxify.com/run/wiki/
>
> But not in terms of it being a wiki chat, just in terms of clicking
> outside of the field starts to save it after 5 seconds. It''d be
ideal
> to have a "cancel" button which reverted to the server-side
version
> as well... I''d probably have a link and a bit of text underneath
> which said something like "will save in x seconds - save now - cancel
> save".
>
> Could someone help me to work out how I''d do this? I thought
it''d be
> something like an observer, but this doesn''t seem to have a
callback
> based on focus (selection?) being set outside of a form element. Is
> it just a matter of writing a small javascript tag into the form
> element which says (on click outside of me, submit the form)? I''m
not
> overly familiar with JavaScript unfortunately.
>
> Many thanks (and apologies if this appears twice.)
> Julian.
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>