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) { ...@@ -517,7 +517,7 @@ Casper.prototype.fill = function fill(selector, vals, submit) {
517 if (submit) { 517 if (submit) {
518 this.evaluate(function(selector) { 518 this.evaluate(function(selector) {
519 var form = __utils__.findOne(selector); 519 var form = __utils__.findOne(selector);
520 var method = form.getAttribute('method').toUpperCase() || "GET"; 520 var method = (form.getAttribute('method') || "GET").toUpperCase();
521 var action = form.getAttribute('action') || "unknown"; 521 var action = form.getAttribute('action') || "unknown";
522 __utils__.log('submitting form to ' + action + ', HTTP ' + method, 'info'); 522 __utils__.log('submitting form to ' + action + ', HTTP ' + method, 'info');
523 form.submit(); 523 form.submit();
......