JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://semantic-ui.com/dist/semantic.css">
<script src="http://semantic-ui.com/dist/semantic.js"></script>
<div class="ui form">
<div class="field">
<label>Username</label>
<input type="text" name="username" value="" />
</div>
<div class="field">
<div class="ui primary submit button">
Save
</div>
</div>
CSS
body {
padding: 1em;
}
JavaScript
$('.ui.form').form({
fields: {
username: {
identifier: 'username',
rules: [{
type: 'maxLength[3]',
prompt: 'Please enter a username'
}]
}
},
onSuccess: function() {
alert("ok");
return false;
}
});