From 14e0a4a03855fe8e7ffeffd0d7f39a063f80c31e Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Thu, 12 Sep 2013 14:58:34 -0400 Subject: [PATCH] Show order errors in page instead of in an alert. --- lms/static/js/verify_student/photocapture.js | 6 +++++- lms/templates/verify_student/photo_verification.html | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lms/static/js/verify_student/photocapture.js b/lms/static/js/verify_student/photocapture.js index 47c6b653fb..5f39a6e55e 100644 --- a/lms/static/js/verify_student/photocapture.js +++ b/lms/static/js/verify_student/photocapture.js @@ -50,7 +50,11 @@ var submitToPaymentProcessing = function() { $("#pay_form").submit(); }) .fail(function(jqXhr,text_status, error_thrown) { - alert(jqXhr.responseText); + if(jqXhr.status == 400) { + $('#order-error .copy p').html(jqXhr.responseText); + } + $('#order-error').show(); + $("html, body").animate({ scrollTop: 0 }); }); } diff --git a/lms/templates/verify_student/photo_verification.html b/lms/templates/verify_student/photo_verification.html index bec59216be..71d18f1f39 100644 --- a/lms/templates/verify_student/photo_verification.html +++ b/lms/templates/verify_student/photo_verification.html @@ -38,6 +38,17 @@ +