I Have a 2 Address FromAddress and ToAddress. I have a one checkbox on visual force page like SameAsFromAddress. When I click on that checkbox I'm copying address using jQuery, but this jQuery is not working only in IE8 and working fine in all browsers like IE10, Chrome and Mozilla.
<apex:page standardController="Account" extensions="MyController">
<apex:form>
<apex:pageBlock>
<apex:pageBlockButtons>
<apex:inputCheckbox styleClass="copyLink">Copy</apex:inputcheckbox>
</apex:pageBlockButtons>
<apex:pageBlockSection>
<apex:repeat value="{!fromFields}" var ="f">
<apex:inputField value="{!Account[f]}" styleClass="{!f}"/>
</apex:repeat>
<apex:repeat value="{!toFields}" var ="f">
<apex:inputField value="{!Account[f]}" styleClass="{!f}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<apex:includeScript value="//code.jquery.com/jquery-1.11.0.min.js"/>
<script>
var j$ = jQuery.noConflict();
var addClick = function() {
j$('.copyLink').click(function(e) {
var fromFields = [<apex:repeat value="{!fromFields}" var ="f">'{!f}',</apex:repeat>];
var toFields = [<apex:repeat value="{!toFields}" var ="f">'{!f}',</apex:repeat>];
for (var i = 0; i < fromFields.length; i++) {
j$('.' + toFields[i]).val(j$('.' + fromFields[i]).val());
}
});
};
j$(document).ready(addClick);
</script>