Skip to content
GitLab
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
9b7dd3f7
Commit
9b7dd3f7
authored
Oct 07, 2011
by
stef
Browse files
[fix] confirmation only submits when email field is set
parent
f46154f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/list.html
View file @
9b7dd3f7
...
...
@@ -17,7 +17,13 @@
$
(
'
#sortedlist
'
).
tableFilter
();
$
(
'
.confirm_form
'
).
submit
(
function
()
{
var
self
=
this
;
$
.
ajax
({
url
:
'
/confirm/
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
/
'
+
$
(
this
).
children
(
'
input:first
'
).
attr
(
'
value
'
),
success
:
function
(
data
)
{
$
(
self
).
html
(
data
);
}});
var
email
=
$
(
this
).
children
(
'
input:first
'
).
attr
(
'
value
'
);
if
(
email
.
length
>
0
)
{
$
.
ajax
({
url
:
'
/confirm/
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
/
'
+
email
,
success
:
function
(
data
)
{
$
(
self
).
html
(
data
);
}});
}
else
{
console
.
log
(
$
(
this
).
find
(
'
[type=submit]
'
));
$
(
this
).
find
(
'
[type=text]
'
).
focus
();
}
return
false
;
});
$
(
"
.confirm > .button
"
).
click
(
function
(){
...
...
templates/view.html
View file @
9b7dd3f7
...
...
@@ -38,7 +38,13 @@ $(document).ready(function() {
bindPostCommentHandler
();
$
(
'
.confirm_form
'
).
submit
(
function
()
{
var
self
=
this
;
$
.
ajax
({
url
:
'
/confirm/
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
/
'
+
$
(
this
).
children
(
'
input:first
'
).
attr
(
'
value
'
),
success
:
function
(
data
)
{
$
(
self
).
html
(
data
);
}});
var
email
=
$
(
this
).
children
(
'
input:first
'
).
attr
(
'
value
'
);
if
(
email
.
length
>
0
)
{
$
.
ajax
({
url
:
'
/confirm/
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
/
'
+
email
,
success
:
function
(
data
)
{
$
(
self
).
html
(
data
);
}});
}
else
{
console
.
log
(
$
(
this
).
find
(
'
[type=submit]
'
));
$
(
this
).
find
(
'
[type=text]
'
).
focus
();
}
return
false
;
});
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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