main.js
1.09 KB
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
/**
* Created by vitaliy on 23.11.15.
*/
$(document).ready(function(){
$('#accountsform-country').change(function(){
var region_id = $(this).val();
if(region_id){
$.get( "/ajax/get-city", {region_id:region_id}, function( data ) {
var $input = $('#accounts-city');
$input.empty();
$input.append(data);
});
}
});
$('#company').click(function(){
$(this).addClass('active_button');
$('#person').removeClass('active_button');
$('#accountsform-company').attr('type', 'text').attr('placeholder', 'Компания').val('');
$('.field-accountsform-company').css('display','block');
$('#accountsform-is_firm').val('1');
});
$('#person').click(function(){
$('#company').removeClass('active_button');
$(this).addClass('active_button');
$('.field-accountsform-company').css('display','none');
$('#accountsform-company').attr('type', 'hidden').val('Частное лицо');
$('#accountsform-is_firm').val('0');
});
});