Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Created by .ignore support plugin (hsz.mobi)
.idea
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/JavascriptFormValidator.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 76 additions & 0 deletions src/demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!Doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=0.9">
</head>
<body>
<div>
<form name="demo_validation" id="demoValidation" novalidate>
<div>
<div>
<label for="name">Name :</label>
<input type="text" data-allow="onlyAlpha" id="check" data-allowSpecial="_." value="" name="name" required>
</div>
<div>
<label for="name">String :</label>
<input type="text" data-allow="string" value="" name="name" required>
</div>
<div>
<label for="name">String + [0-5]:</label>
<input type="text" data-allow="^[a-zA-Z0-5]+$" value="" name="name" required>
</div>
<div>
<label for="name">Number in [3-7] :</label>
<input type="number" name="name" id="number" min="3" max="7" required>
</div>
<div>
<label for="name">Password :</label>
<input type="password" data-check="rePassword" id="password" data-allow="^[a-zA-Z0-5]+$" value=""
name="name"
required>
</div>
<div>
<label for="name">Re-Password :</label>
<input type="password" name="name" data-parent="password" id="rePassword" data-allow="^[a-zA-Z0-5]+$"
required>
</div>
<div>
<select required>
<option value="123">123</option>
</select>
</div>
<div>
<select required>
<option value="456">456</option>
</select>
</div>
<div>
<textarea required></textarea>
</div>
</div>
<input type="submit" value="Save">
</form>
</div>

<!--<script src="./../js/formValidator.min.js"></script>-->
<!--<script src="./../js/validatorNew.js"></script>-->
<script src="../js/validatorNew.es6.js"></script>
<script>

(function () {

// var val = jsValidator.init({
// form: 'demoValidation',
// onlyFilter: false
// });

var val = new jsValidator().init({
form: 'demoValidation',
onlyFilter: false
});

}());
</script>
</body>
</html>
15 changes: 2 additions & 13 deletions src/js/formValidator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//---------------------Form New Ticket---------------------------

var warning_font_color = '#761c19';
var warning_class = '';
var form = {
Expand All @@ -21,9 +20,9 @@ var form = {
elements[0].parentNode.removeChild(elements[0]);
}
// **********************************VALIDATE AND POPULATE******************************************

// ----------------------------------GENERAL VALIDATION [Input]-------------------------------------

// Start Searching Elements for Validation.
for (var i = 0; i < st_form_inputs.length; i++) {
if (st_form_inputs[i].required == true) {
Expand Down Expand Up @@ -288,14 +287,4 @@ function validate(data) {
// Trigger the Validation process.
function initValidation(activeForm) {
return form.validate(activeForm);
}


var data = {
form: 'new_ticket_form',
warning_color: 'aa0000',
new_class: 'test'
};

// Default Form Init.
validate(data);
1 change: 1 addition & 0 deletions src/js/formValidator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading