| |
Prototype & script.aculo.us |
Hi,
I don't know what's wrong, but I do have a couple of observations for
1. On this line:
new Form.Observer('checkform', 0.3, function(){
Since the function is otherwise reusable for multiple forms, I wonder
new Form.Observer(formthis.id, 0.3, function(){
...instead (or formthis.identify() if there's a chance that forms will
2. You're relying on semicolon insertion. Semicolon insertion is a
3. IE has this confusion around IDs and NAMEs, it puts them in the
FWIW (which may be nothing -- but I'd love to hear if one of those was
On Jul 8, 6:57 pm, JC <mims1...@gmail.com> wrote:
> function AutosaveForm(formthis){
> }
> I call AutosaveForm from html in the page. In Firefox it works fine,
you -- they might help, you never know.
if you might want:
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.
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.)
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.
it),
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available
> var alertTimerid = 0;
> new Form.Observer('checkform', 0.3, function(){
> clearTimeout (alertTimerid);
> alertTimerid = setTimeout (function(){
> formthis.request({
> onComplete: function(){alert('Form data saved!')}
> })
> }, 1000)
> })
> 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?