Commit 3615bf655f36e882a492bed1e37a62d73c36886b
1 parent
949cc0e7
Exists in
master
and in
1 other branch
serve para mudar o foco para mensagem de erro de campo vazio bem como
para o campo "vazio" após clicar no link da mensagem
Showing
1 changed file
with
49 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,49 @@ |
1 | +$(document).ready(function() | |
2 | + | |
3 | +{ | |
4 | + | |
5 | + // funcionalidade para exibir a 'tab' correspondente ao link da mensagem de | |
6 | + // erro do campo vazio | |
7 | + // e focar no campo obrigatório da página 'index.jsp' | |
8 | + | |
9 | + var focarMensagemErro = true; | |
10 | + | |
11 | + $("#mensagemErroCampoVazio_url").click(function() { | |
12 | + focarMensagemErro = false; | |
13 | + $("#tab-1").prop("checked", true); | |
14 | + $("#url").focus(); | |
15 | + | |
16 | + | |
17 | + }); | |
18 | + | |
19 | + $("#mensagemErroCampoVazio_up_file").click(function() { | |
20 | + focarMensagemErro = false; | |
21 | + $("#tab-2").prop("checked", true); | |
22 | + $("#up_file").focus(); | |
23 | + | |
24 | + }); | |
25 | + | |
26 | + $("#mensagemErroCampoVazio_input").click(function() { | |
27 | + focarMensagemErro = false; | |
28 | + $("#tab-3").prop("checked", true); | |
29 | + $("#input").focus(); | |
30 | + | |
31 | + }); | |
32 | +if(focarMensagemErro) | |
33 | + { | |
34 | + if ($("#mensagemErroCampoVazio_url").length) { | |
35 | + $("#mensagemErroCampoVazio_url").focus(); | |
36 | + } | |
37 | + | |
38 | + if ($("#mensagemErroCampoVazio_up_file").length) { | |
39 | + $("#mensagemErroCampoVazio_up_file").focus(); | |
40 | + focarMensagemErro = false; | |
41 | + } | |
42 | + | |
43 | + if ($("#mensagemErroCampoVazio_input").length) { | |
44 | + $("#mensagemErroCampoVazio_input").focus(); | |
45 | + focarMensagemErro = false; | |
46 | + } | |
47 | + } | |
48 | +}); | |
49 | + | ... | ... |