Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- <title></title>
- <script type="text/javascript" src="js/alertify.js"></script>
- <link rel="stylesheet" type="text/css" href="css/alertify.css">
- </head>
- <body>
- <form id="form">
- <h3>Account</h3>
- <br />
- <label for="userName">User name *</label>
- <br />
- <input id="userName" name="userName" type="text" class="required">
- <br />
- <label for="password">Password *</label>
- <br />
- <input id="password" name="password" type="text" class="required">
- <br />
- <label for="confirm">Confirm Password *</label>
- <br />
- <input id="confirm" name="confirm" type="text" class="required">
- <p>(*) Mandatory</p>
- <input type="button" id="submit" onclick="checkFields()" value="OK">
- </form>
- </body>
- </html>
- <script type="text/javascript">
- function checkFields() {
- var user = document.forms["form"]["userName"].value;
- var password = document.forms["form"]["password"].value;
- var confirm= document.forms["form"]["confirm"].value;
- if (user == "" || password == "" || confirm == "") {
- alert("Name must be filled out");
- return false;
- }
- if (password != confirm) {
- alertify.alert('Viga','Paroolid ei ühti!');
- }
- var matches = password.match(/\d+/g);
- if (matches == null) {
- alert('Parool peab sisestama vähemalt ühte numbrit');
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement