-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
73 lines (61 loc) · 2.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Screenset Validation</title>
<script type="text/javascript">
window.__gigyaConf = {
// Get full list of customLang keys with:
// console.log(gigya.i18n['gigya.services.accounts.plugins.screenSet.js']['en']);
customLang: {
email_already_exists: 'You already have an account'
},
// Validate each screen.
validation: {
// formData contains all information user has entered
// eventType is either "change" or "keypress"
// callback is optional, you can use it for asynchronous validation or just use return
'gigya-register-screen': function(formData, eventType, callback) {
var errors = {};
// Override default error message for required fields.
if(formData['email'] === '') {
errors['email'] = 'We need your email, please!';
}
// This will fail if the email has any lowercase characters.
if(formData['email'] && formData['email'] !== formData['email'].toUpperCase()) {
errors['email'] = 'Lowercase characters not allowed';
}
// This will fail if the first name doesn't start with a capital letter.
if(formData['profile.firstName'] && formData['profile.firstName'].substr(0, 1) !== formData['profile.firstName'].toUpperCase().substr(0, 1)) {
errors['profile.firstName'] = 'First names start with capital letters';
}
// Make checkbox mandatory.
if(!formData['data.subscribe']) {
// Checkboxes don't have error messages.
errors['data.subscribe'] = true;
}
// You can return errors OR use callback for validation via AJAX.
return errors;
},
'gigya-complete-registration-screen': function(formData, eventType, callback) {
var errors = {};
// This will fail if the email has any lowercase characters.
if(formData['profile.email'] && formData['profile.email'] !== formData['profile.email'].toUpperCase()) {
errors['profile.email'] = 'Lowercase characters not allowed';
}
return errors;
}
}
};
</script>
<script type="text/javascript" src="http://cdn.gigya.com/JS/gigya.js?apiKey=3_56CgIuwIjbF03nCwBUkuXzAOlYBkzfiH6PDqavQEESvOk-zxB2tr2xAP2YgDg6Ih"></script>
<script type="text/javascript" src="//cdn.gigya-ext.com/screenset-validation.min.js"></script>
<script type="text/javascript">
gigya.accounts.showScreenSet({
screenSet: 'Default-RegistrationLogin',
startScreen: 'gigya-register-screen'
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body></body>
</html>