From 9442815f1cb1b3e84df4417a96099050e9cd180d Mon Sep 17 00:00:00 2001 From: vivekarora Date: Tue, 17 Sep 2013 12:01:52 +0530 Subject: [PATCH] CRM-13368 - Fixed js code to work same in all browsers ---------------------------------------- * CRM-13368: "New Relationship" does not support "-create new contact-" in Internet Explorer http://issues.civicrm.org/jira/browse/CRM-13368 --- templates/CRM/Contact/Form/Relationship.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/CRM/Contact/Form/Relationship.tpl b/templates/CRM/Contact/Form/Relationship.tpl index 40295ddcc5..220eab57ed 100644 --- a/templates/CRM/Contact/Form/Relationship.tpl +++ b/templates/CRM/Contact/Form/Relationship.tpl @@ -185,10 +185,10 @@ var postUrl = "{/literal}{crmURL p='civicrm/ajax/relationshipContactTypeList' h=0}{literal}"; cj.post( postUrl, { relType: relType }, function ( response ) { - cj( selectID ).get(0).add(new Option('{/literal}{ts escape="js"}- create new contact -{/ts}{literal}', ''), document.all ? i : null); + cj( selectID ).append(new Option('{/literal}{ts escape="js"}- create new contact -{/ts}{literal}', '')); response = eval( response ); - for (i = 0; i < response.length; i++) { - cj( selectID ).get(0).add(new Option(response[i].name, response[i].value), document.all ? i : null); + for (i = 0; i <= response.length; i++) { + cj( selectID ).append(new Option(response[i].name, response[i].value)); } } ); -- 2.25.1