lib/actions.js
function submitForm(page, ph, callback) {
    var oldUrl;
    async.waterfall([
        function (callback) {
            page.get('url', function (url) {
                oldUrl = url;
                callback();
            });
        },
        function (callback) {
            page.evaluate(function () {
                try {
                    document.forms[0].submit();
                    return null;
                } catch (error) {
                    return error;
                }
            }, function (error) {
                // do this because if there is no error, the error is still something so we can't simply do callback(error, page, ph);
                if (error) {
                    callback(error);
                    return;
                }
                callback()
            });
        }, function (callback) {
            checks.pageHasChanged(page, oldUrl, function (error) {
                callback(error);
            });
        }
    ], function (error) {
        callback(error, page, ph);
    });
}
function submitForm(page, ph, callback) {
    var oldUrl;
    async.waterfall([
        function (callback) {
            page.get('url', function (url) {
                oldUrl = url;
                callback();
            });
        },
        function (callback) {
            page.evaluate(function () {
                try {
                    document.forms[0].submit();
                    return null;
                } catch (error) {
                    return error;
                }
            }, function (error) {
                // do this because if there is no error, the error is still something so we can't simply do callback(error, page, ph);
                if (error) {
                    callback(error);
                    return;
                }
                callback()
            });
        }, function (callback) {
            checks.pageHasChanged(page, oldUrl, function (error) {
                callback(error);
            });
        }
    ], function (error) {
        callback(error, page, ph);
    });
}
function submitForm ( page , ph , callback ) { var oldUrl ; async . waterfall ( [ function ( callback ) { page . get ( 'url' , function ( url ) { oldUrl = url ; callback ( ) ; } ) ; } , function ( callback ) { page . evaluate ( function ( ) { try { document . forms [ 0 ] . submit ( ) ; return null ; } catch ( error ) { return error ; } } , function ( error ) { // do this because if there is no error, the error is still something so we can't simply do callback(error, page, ph); if ( error ) { callback ( error ) ; return ; } callback ( ) } ) ; } , function ( callback ) { checks . pageHasChanged ( page , oldUrl , function ( error ) { callback ( error ) ; } ) ; } ] , function ( error ) { callback ( error , page , ph ) ; } ) ; }
Submits a form on the page
@param page
@param ph
@param {pageCallback} callback
Submits a form on the page