diff --git a/ddportfolioservice/templates/showformscript.mako b/ddportfolioservice/templates/showformscript.mako index 93a85bc..84202c3 100644 --- a/ddportfolioservice/templates/showformscript.mako +++ b/ddportfolioservice/templates/showformscript.mako @@ -65,16 +65,22 @@ function updateFields(data, textStatus) { } } +function onChangeShowAll(event) { + alert(event); +} + function onBlurEmail() { - $.ajax({ - 'url' : '${h.url_for(action='fetchdddata')}', - 'data' : {'email' : $('#email').attr('value')}, - 'dataType' : 'json', - 'success' : updateFields, - 'error' : function(request, textStatus, errorThrown) { - $('#email').focus(); - } - }); + if ($.trim($('#email').attr('value')).length > 0) { + $.ajax({ + 'url' : '${h.url_for(action='fetchdddata')}', + 'data' : {'email' : $('#email').attr('value')}, + 'dataType' : 'json', + 'success' : updateFields, + 'error' : function(request, textStatus, errorThrown) { + $('#email').focus(); + } + }); + } } $(document).ready(function() {