mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 14:29:36 +00:00
130 lines
4.4 KiB
HTML
Executable File
130 lines
4.4 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>API</title>
|
|
<meta charset="utf-8">
|
|
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
|
|
<script src="../../js/jquery.min.js"></script>
|
|
<script src="../../js/jszip.min.js"></script>
|
|
<script src="../../js/kendo.all.min.js"></script>
|
|
<script src="../content/shared/js/console.js"></script>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<a class="offline-button" href="../index.html">Back</a>
|
|
|
|
<div class="configurator">
|
|
<div class="header">Configurator</div>
|
|
<div class="box-col">
|
|
<h4>Validate / Clear Form</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<button id="validate" class="k-button">Validate</button>
|
|
<button id="clear" class="k-button">Clear</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="box-col">
|
|
<h4>Vertical / Horizontal Orientation</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<button id="vertical" class="k-button">Vertical</button>
|
|
<button id="horizontal" class="k-button">Horizontal</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="example">
|
|
<div class="demo-section k-content">
|
|
<div id="validation-success"></div>
|
|
|
|
<form id="exampleForm"></form>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
var validationSuccess = $("#validation-success");
|
|
|
|
$("#exampleForm").kendoForm({
|
|
formData: {
|
|
Username: "johny",
|
|
Email: "[email protected]",
|
|
Password: "pass123",
|
|
Birth: new Date(),
|
|
Agree: false
|
|
},
|
|
items: [{
|
|
type: "group",
|
|
label: "Registration Form",
|
|
items: [
|
|
{ field: "Username", label: "Username:", validation: { required: true } },
|
|
{ field: "Email", label: "Email:", validation: { required: true, email: true } },
|
|
{
|
|
field: "Password",
|
|
label: "Password:",
|
|
validation: { required: true },
|
|
hint: "Hint: enter alphanumeric characters only.",
|
|
editor: function(container, options) {
|
|
container.append($("<input type='password' class='k-textbox k-valid' id='Password' name='Password' title='Password' required='required' autocomplete='off' aria-labelledby='Password-form-label' data-bind='value:Password' aria-describedby='Password-form-hint'>"));
|
|
}
|
|
},
|
|
{ field: "Birth", label: { text: "Date of birth:", optional: true } },
|
|
{ field: "Agree", label: "Agree to Terms:", validation: { required: true } },
|
|
]
|
|
}],
|
|
validateField: function (e) {
|
|
validationSuccess.html("");
|
|
},
|
|
submit: function (e) {
|
|
e.preventDefault();
|
|
validationSuccess.html("<div class='k-messagebox k-messagebox-success'>Form data is valid!</div>");
|
|
},
|
|
clear: function (ev) {
|
|
validationSuccess.html("");
|
|
}
|
|
});
|
|
|
|
var form = $("#exampleForm").data("kendoForm");
|
|
|
|
$("#validate").click(function() {
|
|
form.validate();
|
|
});
|
|
|
|
$("#clear").click(function() {
|
|
form.clear();
|
|
});
|
|
|
|
$("#vertical").click(function () {
|
|
form.setOptions({
|
|
orientation: "vertical"
|
|
})
|
|
|
|
validationSuccess.html("");
|
|
});
|
|
|
|
$("#horizontal").click(function () {
|
|
form.setOptions({
|
|
orientation: "horizontal"
|
|
})
|
|
|
|
validationSuccess.html("");
|
|
});
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|