Commit 9b7dd3f7 authored by stef's avatar stef
Browse files

[fix] confirmation only submits when email field is set

parent f46154f6
......@@ -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(){
......
......@@ -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;
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment