Hi,

I don't know what's wrong, but I do have a couple of observations for
you -- they might help, you never know.

1. On this line:

    new Form.Observer('checkform', 0.3, function(){

Since the function is otherwise reusable for multiple forms, I wonder
if you might want:

    new Form.Observer(formthis.id, 0.3, function(){

...instead (or formthis.identify() if there's a chance that forms will
be passed in that don't have an ID).  Otherwise, I could call
AutosaveForm($("myform")) and end up submitting changes to "myform"
when "checkform" changes, which probably isn't what you want.

2. You're relying on semicolon insertion.  Semicolon insertion is a
very, very bad thing (especially when you start wanting to minify your
code for deployment), I would suggest _never_ relying on it.  (But I
don't immediately see any reason to believe that's what's wrong.)

3. IE has this confusion around IDs and NAMEs, it puts them in the
same namespace although that's clearly completely wrong.  I don't
suppose there might be something else on the page that has *either* a
name or id attribute with the value "checkform"?  Because if there is,
it's anyone's guess which one will get picked at runtime, the behavior
is not reliable cross-browser.  IDs (as I'm sure you know) must be
completely unique within the page, and with IE you also have to worry
about names getting conflated with them as well.  Great fun.

FWIW (which may be nothing -- but I'd love to hear if one of those was
it),
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 8, 6:57 pm, JC <mims1...@gmail.com> wrote:
> Here's my function:
>
> function AutosaveForm(formthis){
>     var alertTimerid = 0;
>     new Form.Observer('checkform', 0.3, function(){
>         clearTimeout (alertTimerid);
>         alertTimerid = setTimeout (function(){
>             formthis.request({
>                 onComplete: function(){alert('Form data saved!')}
>             })
>         }, 1000)
>     })
>
> }
>
> I call AutosaveForm from html in the page.  In Firefox it works fine,
> after 1 second after the form is modified it submits the results and
> alerts me that the data was saved.  But in IE it just alerts me that
> it was saved but doesn't actually save the data that was modified,
> when I refresh the page its the old data.  Any Ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to