forked from newscoop/theme-Liquid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
register_confirm.tpl
41 lines (34 loc) · 1.13 KB
/
register_confirm.tpl
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
{{extends file="layout.tpl"}}
{{block content}}
<div class="article_content bloger content_text white-box">
<div class="clearfix">
<h3 class="normal_header">{{'pleaseFill'|translate}}</h3>
<div class="register_form">
{{ $form }}
<script type="text/javascript">
$('#first_name, #last_name').keyup(function() {
$.post('{{ $view->url(['controller' => 'register', 'action' => 'generate-username'], 'default') }}?format=json', {
'first_name': $('#first_name').val(),
'last_name': $('#last_name').val()
}, function (data) {
$('#username').val(data.username).css('color', 'green');
}, 'json');
});
$('#username').change(function() {
$.post('{{ $view->url(['controller' => 'register', 'action' => 'check-username'], 'default') }}?format=json', {
'username': $(this).val()
}, function (data) {
if (data.status) {
$('#username').css('color', 'green');
} else {
$('#username').css('color', 'red');
}
}, 'json');
}).keyup(function() {
$(this).change();
});
</script>
</div>
</div>
</div>
{{/block}}