Bug 18569 - Quick add patron will not copy over details from cities and towns pull down into patron details

Followed test plan and the city value updates in the quick add form correctly.
Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e609679eb2)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Nick Clemens 2017-05-12 09:38:37 -04:00 committed by Katrin Fischer
parent df74913f2e
commit 8ebbefed73
1 changed files with 7 additions and 6 deletions

View File

@ -307,13 +307,14 @@ $(document).ready(function(){
$("#quick_add_form #guarantorsearch, #guarantorsearch").val(LABEL_SET_TO_PATRON);
});
$("#select_city").change(function(){
$(document.body).on('change','select[name="select_city"]',function(){
$('select[name="select_city"]').val( $(this).val() );
var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/);
document.form.select_city.value.match(myRegEx);
document.form.zipcode.value=RegExp.$1;
document.form.city.value=RegExp.$2;
document.form.state.value=RegExp.$3;
document.form.country.value=RegExp.$4;
$(this).val().match(myRegEx);
$('input[name="zipcode"]').val( RegExp.$1 );
$('input[name="city"]').val( RegExp.$2 );
$('input[name="state"]').val( RegExp.$3 );
$('input[name="country"]').val( RegExp.$4 );
});
$("#dateofbirth").datepicker({ maxDate: "-1D", yearRange: "c-120:" });