Created
October 20, 2014 12:25
-
-
Save ranraj/873c84c9a3366f8abfe1 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/newex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://cdn.alloyui.com/1.0.3/aui/aui.js"></script> | |
<link | |
href="http://cdn.alloyui.com/1.0.3/aui-skin-classic/css/aui-skin-classic-all-min.css" | |
rel="stylesheet"> | |
</head> | |
<body> | |
<form id="myForm"> | |
<div class="control-group"> | |
<label class="control-label" for="name">Name:</label> | |
<div class="controls"> | |
<input name="name" id="name" type="text"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label" for="name">Select:</label> | |
<div class="controls"> | |
<select name="selectOption"> | |
<option value=""></option> | |
<option value="1">Option1</option> | |
<option value="2">Option2</option> | |
</select> | |
</div> | |
</div> | |
<div class="control-group"> | |
<div class="controls"> | |
<input type="submit" value="save" /> | |
</div> | |
</div> | |
</form> | |
<script id="jsbin-javascript"> | |
AUI().use( | |
'aui-form-validator', | |
function(A) { | |
new A.FormValidator( | |
{ | |
boundingBox: '#myForm', | |
rules: { | |
name: { | |
required: true | |
}, | |
selectOption: { | |
required: true | |
} | |
} | |
}); | |
} | |
); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://cdn.alloyui.com/1.0.3/aui/aui.js"><\/script> | |
<link | |
href="http://cdn.alloyui.com/1.0.3/aui-skin-classic/css/aui-skin-classic-all-min.css" | |
rel="stylesheet"> | |
</head> | |
<body> | |
<form id="myForm"> | |
<div class="control-group"> | |
<label class="control-label" for="name">Name:</label> | |
<div class="controls"> | |
<input name="name" id="name" type="text"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label" for="name">Select:</label> | |
<div class="controls"> | |
<select name="selectOption"> | |
<option value=""></option> | |
<option value="1">Option1</option> | |
<option value="2">Option2</option> | |
</select> | |
</div> | |
</div> | |
<div class="control-group"> | |
<div class="controls"> | |
<input type="submit" value="save" /> | |
</div> | |
</div> | |
</form> | |
</body> | |
</html> | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript"> AUI().use( | |
'aui-form-validator', | |
function(A) { | |
new A.FormValidator( | |
{ | |
boundingBox: '#myForm', | |
rules: { | |
name: { | |
required: true | |
}, | |
selectOption: { | |
required: true | |
} | |
} | |
}); | |
} | |
);</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUI().use( | |
'aui-form-validator', | |
function(A) { | |
new A.FormValidator( | |
{ | |
boundingBox: '#myForm', | |
rules: { | |
name: { | |
required: true | |
}, | |
selectOption: { | |
required: true | |
} | |
} | |
}); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AUI form validation for Text and select.
Note : the select option value should be empty as default.