Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
33212c30
Commit
33212c30
authored
May 01, 2011
by
stef
Browse files
[fix] better advancement to next input, in report form
parent
4918dc4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
media/js/form.js
View file @
33212c30
...
...
@@ -14,6 +14,7 @@ function init_form() {
var
country
=
$
(
this
).
attr
(
'
value
'
);
if
(
country
.
length
>
0
)
{
$
(
'
#id_operator
'
).
parent
().
show
();
$
(
'
#id_operator
'
).
focus
();
$
.
getJSON
(
'
/ajax/
'
+
country
,
function
(
data
)
{
$
(
"
#id_operator
"
).
autocomplete
(
data
,
{
minChars
:
0
,
autoFill
:
true
});
});
...
...
@@ -24,6 +25,7 @@ function init_form() {
var
operator
=
$
(
this
).
val
();
if
(
operator
.
length
>
0
)
{
$
(
'
#id_contract
'
).
parent
().
show
();
$
(
'
#id_contract
'
).
focus
();
$
.
getJSON
(
'
/ajax/
'
+
country
+
'
/
'
+
operator
,
function
(
data
)
{
$
(
"
#id_contract
"
).
autocomplete
(
data
,{
minChars
:
0
});
});
...
...
@@ -44,4 +46,12 @@ function init_form() {
$
(
"
#show_optionals
"
).
show
();
}
});
$
(
"
form
"
).
bind
(
"
keypress
"
,
function
(
e
)
{
if
(
e
.
keyCode
==
13
)
{
e
.
preventDefault
();
$
(
e
.
target
).
change
();
return
false
;
}
return
true
;
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment