Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Form.Request documentation incorrectly lists formRequest as the Element Method #1056

Closed
ericcholis opened this Issue · 2 comments

3 participants

@ericcholis

The Form.Request document lists formRequest as the Element Method for Form.Request, when the code actually implements formUpdate.

    Element.implement('formUpdate', function(update, options){
        var fq = this.retrieve('form.request');
        if (!fq){
            fq = new Form.Request(this, update, options);
        } else {
            if (update) fq.setTarget(update);
            if (options) fq.setOptions(options).makeRequest();
        }
        fq.send();
        return this;
    });
@philfreo

Yes -- this is a completely blatant bug in either the documentation or the code.

http://mootools.net/docs/more/Forms/Form.Request#Element:formRequest
Says you should be able to do:
$(element).formRequest(update, options);

http://jsfiddle.net/Pzpvk/

Which yields "... formRequest is not a function"

@ronaldmansveld

I can confirm this discrepancy still exists in More 1.4.0.1

@SergioCrisostomo SergioCrisostomo closed this issue from a commit
@SergioCrisostomo SergioCrisostomo Merge: Update documentation for .formUpdate
Documentation refers to a method `element.formRequest()`.
Such method does not exist (http://jsfiddle.net/CHEuL/).

The method correct name is `.formUpdate()` as can be seen in the source code:

     Element.implement('formUpdate', function(update, options){

console.log($('myForm').formUpdate);  // function (update, options){ ...
console.log($('myForm').formRequest); // undefined

fixes #254
fixes #1056
closes #1254
e578d54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.