From 443c4b5d42aee4bb0db1be3217d3606f311a6274 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 14 May 2012 09:01:03 -0400 Subject: [PATCH] [finish #27015121] give focus to pledge amount box, select premium doesn't reduce pledge --- frontend/templates/pledge.html | 2 +- static/js/prefill_pledge.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/templates/pledge.html b/frontend/templates/pledge.html index 3d90a35d..1a89d9f6 100644 --- a/frontend/templates/pledge.html +++ b/frontend/templates/pledge.html @@ -90,7 +90,7 @@ {% endfor %} - + diff --git a/static/js/prefill_pledge.js b/static/js/prefill_pledge.js index ff5c319b..febee839 100644 --- a/static/js/prefill_pledge.js +++ b/static/js/prefill_pledge.js @@ -1,12 +1,18 @@ -// This autofills the pledge box when users select a premium tier. var $j = jQuery.noConflict(); - +//give pledge box focus +$j(function() { + $j('#id_preapproval_amount').focus(); +}); +// This autofills the pledge box when users select a premium tier. $j().ready(function() { var inputbox = $j('#id_preapproval_amount'); $j('#premiums_list input').click(function() { amount = $j(this).siblings('span.menu-item-price').html(); - amount = amount.split('$')[1] - inputbox.val(amount); + amount = amount.split('$')[1]; + current = inputbox.val(); + if (current