@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/js/members.js | 31 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/js/members.js +++ a/koha-tmpl/intranet-tmpl/prog/js/members.js @@ -186,13 +186,13 @@ function update_category_code(category_code) { function select_user(borrowernumber, borrower) { var form = $('#entryform').get(0); if (form.guarantorid.value) { - $("#contact-details,#quick_add_form #contact-details").find('a').remove(); - $("#contactname, #contactfirstname,#quick_add_form #contact-details").parent().find('span').remove(); + $("#contact-details, #quick_add_form #contact-details").find('a').remove(); + $("#contactname, #contactfirstname, #quick_add_form #contactname, #quick_add_form #contactfirstname").parent().find('span').remove(); } var id = borrower.borrowernumber; form.guarantorid.value = id; - $('#contact-details,#quick_add_form #contact-details') + $('#contact-details, #quick_add_form #contact-details') .show() .find('span') .after('' + id + ''); @@ -215,14 +215,14 @@ function select_user(borrowernumber, borrower) { form.country.value = borrower.country; form.branchcode.value = borrower.branchcode; - $("quick_add_form #streetnumber").val(borrower.streetnumber); - $("quick_add_form #address").val(borrower.address); - $("quick_add_form #address2").val(borrower.address2); - $("quick_add_form #city").val(borrower.city); - $("quick_add_form #state").val(borrower.state); - $("quick_add_form #zipcode").val(borrower.zipcode); - $("quick_add_form #country").val(borrower.country); - $("quick_add_form #branchcode").val(borrower.branchcode); + $("#quick_add_form #streetnumber").val(borrower.streetnumber); + $("#quick_add_form #address").val(borrower.address); + $("#quick_add_form #address2").val(borrower.address2); + $("#quick_add_form #city").val(borrower.city); + $("#quick_add_form #state").val(borrower.state); + $("#quick_add_form #zipcode").val(borrower.zipcode); + $("#quick_add_form #country").val(borrower.country); + $("#quick_add_form select[name='branchcode']").val(borrower.branchcode); form.guarantorsearch.value = LABEL_CHANGE; $("#quick_add_form #guarantorsearch").val(LABEL_CHANGE); @@ -299,13 +299,12 @@ $(document).ready(function(){ $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); $("#guarantordelete").click(function() { - $("#quick_add_form #contact-details,#contact-details").hide().find('a').remove(); - $("#quick_add_form #guarantorid,#quick_add_form #contactname,#quick_add_form #contactfirstname, #guarantorid,#contactname,#contactfirstname").each(function () { this.value = ""; }); - $("#quick_add_form #contactname, #quick_add_form #contactfirstname,#contactname,#contactfirstname") + $("#quick_add_form #contact-details, #contact-details").hide().find('a').remove(); + $("#quick_add_form #guarantorid, #quick_add_form #contactname, #quick_add_form #contactfirstname, #guarantorid, #contactname, #contactfirstname").each(function () { this.value = ""; }); + $("#quick_add_form #contactname, #quick_add_form #contactfirstname, #contactname, #contactfirstname") .each(function () { this.type = 'text'; }) .parent().find('span').remove(); - $("#quick_add_form #guarantorsearch,#guarantorsearch").val(LABEL_SET_TO_PATRON); - $("quick_add_form #guarantorsearch,#guarantorsearch").val(LABEL_SET_TO_PATRON); + $("#quick_add_form #guarantorsearch, #guarantorsearch").val(LABEL_SET_TO_PATRON); }); $("#select_city").change(function(){ --