Shopify/batman — Issue #307: data-replace="main" confuses form submit
Author: wanderview
Created: 2012-01-16 21:00:13+00:00
State: open

I'm currently running into a problem with form submit events inside of a data-replace="main" div. Without the data-replace="main" everything works correctly and the submit event is routed to my controller. When I add the data-replace="main" then the event is no longer routed to the controller. Instead the form submission causes the browser to load a URL with an empty base path and the form parameters appended in normal GET style.

A simple example demonstrating the error:

```html

New Item

Key:

Value:

Cancel

```

When this form is submitted the browser attempts to load:

http://localhost:3000/?item%5Bkey%5D=a&item%5Bvalue%5D=b&commit=Create+Item#!/items/new

This only occurs if the data-replace is set to "main". If you use any other data-yield target then the problem does not seem to occur. The problem also occurs for data-contentfor="main". If you use the default yield replacement semantics without explicitly referencing "main" the problem does not occur.

Tested with both Safari 5.1.2 and Firefox 9.0.1.