Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (33 sloc) 0.941 kB
body {
padding: 50px;
font: 14px Helvetica, Arial;
label {
display: block;
clear: both;
<p>Auto-submit a form with XHR via its action and method:</p>
<div class="login">
<form action="/user" method="post" autosubmit>
<input type="text" name="name" placeholder="Username" />
<input type="password" name="pass" placeholder="Password" />
<input type="submit" value="Login" />
<script src="./reactive.js"></script>
var reactive = require('reactive');
var view = reactive(document.querySelector('.login'));
// custom binding available to this view only
view.bind('autosubmit', function(el){
el.onsubmit = function(e){
var path = el.getAttribute('action');
var method = el.getAttribute('method').toUpperCase();
console.log('submit to %s %s', method, path);
Jump to Line
Something went wrong with that request. Please try again.