Commit ff3714f8 ff3714f8747ddadc21c955eaa7e9590b6aa94138 by Nicolas Perriault

fixes #92 - form submit fails when form element doesn't have method field

1 parent 02f08da1
......@@ -517,7 +517,7 @@ Casper.prototype.fill = function fill(selector, vals, submit) {
if (submit) {
this.evaluate(function(selector) {
var form = __utils__.findOne(selector);
var method = form.getAttribute('method').toUpperCase() || "GET";
var method = (form.getAttribute('method') || "GET").toUpperCase();
var action = form.getAttribute('action') || "unknown";
__utils__.log('submitting form to ' + action + ', HTTP ' + method, 'info');
form.submit();
......