JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="app">
<form name="createEventForm" data-ng-controller="Ctrl">
<fieldset>
<div class="input-prepend">
<span class="add-on">www.blah.com/</span>
<input data-ng-model="slug" ng-change="auto_slug()" id="prependedInput" type="text" placeholder="event-url" required>
</div>
<input type="text" placeholder="etc...">
</fieldset>
</form>
</div>
CSS
</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ -->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<script src="http://code.angularjs.org/angular-1.0.0rc5.min.js"></script>
<style>
JavaScript
var app = angular.module("app", []);
function Ctrl($scope) {
// automatically creates an event slug from the provided event name
$scope.auto_slug = function() {
$scope.slug = $scope.slug.toLowerCase().replace(/[^a-z0-9\-\s]/g, '').replace(/\s+/g, '-');
//TODO: type in "test@@@@@@test". WTF!??!?!?!?
console.log($scope.slug);
};
}