Skip to content

Instantly share code, notes, and snippets.

@ericf
Created August 30, 2010 16:40
Show Gist options
  • Save ericf/557658 to your computer and use it in GitHub Desktop.
Save ericf/557658 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>ValueChange Multiple Subscriptions</title>
</head>
<body>
<h1>ValueChange Multiple Subscriptions</h1>
<form method="get" action="">
<fieldset>
<legend>Da Form</legend>
<label for="my-input">Type Here »</label>
<input id="my-input" type="text" />
</fieldset>
</form>
<script src="../../build/yui/yui.js"></script>
<script>
YUI({
combine : false,
filter : 'RAW'
}).use('node', 'event-valuechange', function(Y){
var myInput = Y.one('#my-input');
myInput.on('valueChange', function(e){
Y.log('sub 1: ' + e.newVal);
});
myInput.on('valueChange', function(e){
Y.log('sub 2: ' + e.newVal);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment