-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature/validate-instance (#94) * validate instance added validate() public method which higlights the ui and returns a boolean whether the instance was valid * validate instance ammend to last commit. somehow line was missing * validate-instance fix for callback functions calling instance.validate() now works in callbacks. precised the condition when to remove the validation error. Updated callback demo * Pull request feedback integrated * Reverted 15-callbacks demo as the programmatic invalidate feature will get its own demo file. * add programmatic validation demo * update demos list * prevent native ui on iOS if disabled * onoptionclick callback * changelog * generate bundle Co-authored-by: Alex Milde <[email protected]>
- Loading branch information
1 parent
525f775
commit 96c3730
Showing
24 changed files
with
289 additions
and
49 deletions.
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!doctype HTML> | ||
<html> | ||
<head> | ||
<title>Programmatic Validation | EasyDropDown Demo</title> | ||
|
||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | ||
|
||
<link href="./style.css" rel="stylesheet"/> | ||
<link id="theme-sheet" href="./themes/flax.css" rel="stylesheet"/> | ||
<link rel="shortcut icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAb1BMVEUAAABCiZtUyORUyORCiZtUyORCiZtUyORCiZtUyORUyORCiZtUyORCiZtUyOREkKNUyORUyORUyORCiZtUyORUyORCiZtUyORCiZtUyORCiZtDjaBFlalHma1KpbtLqcBOtM1QuNJSwNtTxN9UyOQlYZhqAAAAGnRSTlMAEBAgMDBAQFBQYHBwgICPj5+vv7/P39/v793jxf8AAACqSURBVHja1ZJdF4IgDIYnZaaVpWbKrCzl///GIokYH3btc/fuPBwGGywCQeH5HyEVyaxwAsHZjFDLfA4LfPXJeVBIVU4CQvHNDfMKNdO59Ak8NvLeI2Qkx45Q0NwwSxiO1oHSEq64ta8kwh2xjeymDeGBbyrn2bowdCg5+D4OpgYmNlQQmRJ6VLSRMzxZeKKmcscPYuzwx85ZIBA3NFnbKwg9Ei4jFTgsgRepVztePP0rPgAAAABJRU5ErkJggg=="> | ||
|
||
<script src="./scripts/themeSwitcher.js"></script> | ||
<script src="./scripts/submitHandler.js"></script> | ||
</head> | ||
<body> | ||
<main class="main"> | ||
<h2 class="sub-heading">EasyDropDown Demo</h2> | ||
|
||
<h1 class="heading">16. Programmatic Validation</h1> | ||
|
||
<form class="demo-container" method="post"> | ||
<select required id="test"> | ||
<option value="">Expiry Month</option> | ||
<option>January</option> | ||
<option>February</option> | ||
<option>March</option> | ||
<option>April</option> | ||
<option>May</option> | ||
<option>June</option> | ||
<option>July</option> | ||
<option>August</option> | ||
<option>September</option> | ||
<option>October</option> | ||
<option>November</option> | ||
<option>December</option> | ||
</select> | ||
|
||
<button type="button" class="button" id="validate">Validate</button> | ||
</form> | ||
|
||
<div class="theme-switcher"> | ||
<div class="theme-switcher-label">Theme:</div> | ||
|
||
<div class="theme-switcher-options"> | ||
<button type="button" data-theme="./themes/flax.css" class="active">Flax</button> | | ||
<button type="button" data-theme="./themes/beanstalk.css">Beanstalk</button> | | ||
<button type="button" data-theme="./themes/ivy.css">Ivy</button> | ||
</div> | ||
</div> | ||
</main> | ||
|
||
<footer class="footer"> | ||
<a target="_blank" href="https://github.com/patrickkunka/easydropdown">EasyDropDown v4</a> | ||
<a target="_blank" href="https://www.kunkalabs.com">© KunkaLabs Ltd</a> | ||
</footer> | ||
|
||
<script src="./easydropdown.js"></script> | ||
<script> | ||
var edd = easydropdown('#test'); | ||
var validateButton = document.querySelector('#validate'); | ||
|
||
validateButton.addEventListener('click', function() { | ||
var isValid = edd.validate(); | ||
|
||
if (isValid) alert('Valid!'); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.