PageSourceSearch

https://emgea.gov.br/Scripts/portal/editarPessoa.js

js emgea.gov.br collected 2026-10-02 19:17:22 UTC 4,579 bytes, 127 lines download raw bytes

1function changeTipo() {
2    if ($("#ddlTipoPessoa option:selected").val() == '1') {
3        $('#divPf').removeClass('hidden');
4        $('#divPj').addClass('hidden');
5
6        $('#NrPessoaDocumentoCNPJ').val('');
7        $('#NrPessoaInscricaoEstadual').val('');
8        $('#DtPessoaCriacao').val('');
9        $('#NmPessoa').removeClass('hidden');
10    } else {
11        $('#divPj').removeClass('hidden');
12        $('#divPf').addClass('hidden');
13
14        $('#NrPessoaDocumentoCPF').val('');
15        $('#NrPessoaDocumentoIdentidade').val('');
16        $('#NtPessoaNascimento').val('');
17        $('#nmPessoa').addClass('hidden');
18    }
19}
20
21function addItem(el) {
22    appMsg('Teste', EnumStatusCode.Sucess);
23    var div = $(el).closest('#divAgrupadorEndereco').clone();
24    LimparCampos(div);
25    $('#divEndereco').append(div);
26    ReendexarEndereco();
27}
28function removeItem(el) {
29    $(el).closest('#divAgrupadorEndereco').remove();
30    ReendexarEndereco();
31}
32function ReendexarEndereco() {
33    var qtd = $('#divEndereco > #divAgrupadorEndereco').length - 1;
34    for (i = 0; i <= qtd; i++) {
35        $('#divEndereco > #divAgrupadorEndereco').each(function () {
36            $(':input', this).each(function () {
37                var type = this.type;
38                var tag = this.tagName.toLowerCase();
39                if (type == 'text' || type == 'password' || tag == 'textarea')
40                    this.name = "Endereco[" + i + "]." + $(this).attr("identificador");
41                //else if (type == 'checkbox' || type == 'radio')
42                //    this.checked = false;
43                //else if (tag == 'select')
44                //    this.selectedIndex = -1;
45            });
46            i++;
47        });
48    }
49
50}
51function LimparCampos(nomeDiv) {
52
53    $(':input', nomeDiv).each(function () {
54        var type = this.type;
55        var tag = this.tagName.toLowerCase(); // normalize case
56        // it's ok to reset the value attr of text inputs,
57        // password inputs, and textareas
58        if (type == 'text' || type == 'password' || tag == 'textarea')
59            this.value = "";
60        else if (type == 'checkbox' || type == 'radio')
61            this.checked = false;
62        else if (tag == 'select')
63            this.selectedIndex = -1;
64    });
65}
66
67
68function addTelefone(el) {
69    var div = $(el).closest('#divAgrupadorTelefone').clone();
70    LimparCampos(div);
71    $('#divTelefone').append(div);
72    ReendexarTelefone();
73}
74function removeTelefone(el) {
75    $(el).closest('#divAgrupadorTelefone').remove();
76    ReendexarTelefone();
77}
78function ReendexarTelefone() {
79    var qtd = $('#divTelefone > #divAgrupadorTelefone').length - 1;
80    for (i = 0; i <= qtd; i++) {
81        $('#divTelefone > #divAgrupadorTelefone').each(function () {
82            $(':input', this).each(function () {
83                var type = this.type;
84                var tag = this.tagName.toLowerCase();
85                if (type == 'text' || type == 'password' || tag == 'textarea')
86                    this.name = "Telefone[" + i + "]." + $(this).attr("identificador");
87                //else if (type == 'checkbox' || type == 'radio')
88                //    this.checked = false;
89                //else if (tag == 'select')
90                //    this.selectedIndex = -1;
91            });
92            i++;
93        });
94    }
95
96}
97function LimparCampos(nomeDiv) {
98    $(':input', nomeDiv).each(function () {
99        var type = this.type;
100        var tag = this.tagName.toLowerCase(); // normalize case
101        // it's ok to reset the value attr of text inputs,
102        // password inputs, and textareas
103        if (type == 'text' || type == 'password' || tag == 'textarea')
104            this.value = "";
105        else if (type == 'checkbox' || type == 'radio')
106            this.checked = false;
107        else if (tag == 'select')
108            this.selectedIndex = -1;
109    });
110}
111
112$('#btnSalvar').on('click', function () {
113    if ($('#frmCadPessoa').valid()) {
114        $.post("/Pessoa/IncluirPessoa/", $("#frmCadPessoa").seri
114alize(), function (data) {
115            if (data.Data.Data === 200) {
116                appMsg('Cadastrado com Sucesso!', EnumStatusCode.Sucess);
117            } else {
118                var msg = "Operação não pode ser realizada";
119                console.log('erro');
120            }
121        });
122    }
123});
124$(document).ready(function () {
125    $('#NrPessoaDocumentoCpf').mask('000.000.000-00');
126    $('#NrPessoaDocumentoCnpj').mask('00.000.000/0000-00');
127});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.