assaf/zombie — Issue #295: Zombie ignores onsubmit on form submission
Author: bmilleare
Created: 2012-03-05 22:07:19+00:00
State: open

As per title - zombie seems to totally disregard the onsubmit attribute of a form when it returns false (which should cancel submission).

Example code:

```html

Form with onSubmit event

Form with onSubmit test

```

```javascript
var zombie = require("zombie");
var browser = new zombie.Browser({ debug: true, runScripts: true });

browser.visit('http://10.0.0.10/form.html', function(err, browser, status) {
browser.fill('#form-input', 'fdsgfadsgfdgs').pressButton('Submit', function (err, browser, status) {
console.log(browser.html());
})
});
```

What I'd expect is for the output to contain a div `update-box` with the text "fdsgfadsgfdgs" as a browser would. Instead, zombie seems to make a second GET upon pressButton to the current page:

```
ben@erebus:~/dev/zombie_test$ node test2.js
Zombie: GET http://10.0.0.10/form.html
Zombie: GET http://10.0.0.10/form.html => 200
Zombie: GET https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js
Zombie: GET https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js => 200
Zombie: GET http://10.0.0.10/form.html?
Zombie: GET http://10.0.0.10/form.html? => 200
Zombie: GET https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js
Zombie: GET https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js => 200
```

nodejs v0.6.12 / zombie 0.12.15