Custom jQuery not working Pagelines 5

Hello,

Recently I've embedded custom jQuery into my website, the functions of this custom script it to allow the user to create more fields in order to input more data (if needed). The script is working on a test server I have setup but not on the site I want it to work on. I have a strong feeling it's to do with the version of jQuery I am using. As I am using functions that are no longer used in version 11+

  • Rupok

    Hi allanlove

    Hope you had a wonderful day.

    The script is working on a test server I have setup but not on the site I want it to work on

    I could tell you better about the issue if I could see the custom jQuery code you are using. Can you please paste the code here so we can have a look and provide you exact solution for this?

    I'm looking forward to hear from you and resolve this issue as soon as possible.

    Have a nice day. Cheers!

  • allanlove

    Hello, Rupok

    Certainly, here is the code.

    $(document).ready(function() {
    
    	$('#packages').change(function() {
    		var packages = $('#packages').val();
    		$('#nopackages').load('multipleParcels.php?qty='+packages);
    	});
    
    	$('#set_same').live('click', function() {
    		var weight = $('.weight_initial').val();
    		var depth = $('.depth_initial').val();
    		var width = $('.width_initial').val();
    		var height = $('.height_initial').val();
    
    		     $(".weight_additional").each(function() {
    		     	$(this).val(weight);
    		     });
    
    		     $(".depth_additional").each(function() {
    		     	$(this).val(depth);
    		     });
    
    		     $(".width_additional").each(function() {
    		     	$(this).val(width);
    		     });
    
    		     $(".height_additional").each(function() {
    		     	$(this).val(height);
    		     });
    
    		return false;
    	});
    
    });
  • allanlove

    Hello,

    After playing around with it for a couple of hours. I've managed to get it working, I noticed a function needed to be replaced as it's no longer in use. The full working code is below:

    $(document).ready(function() {
    
    	$('#packages').change(function() {
    		var packages = $('#packages').val();
    		$('#nopackages').load('multipleParcels.php?qty='+packages);
    	});
    
    	$(document).on('click' , "#set_same", function() {
    		var weight = $('.weight_initial').val();
    		var depth = $('.depth_initial').val();
    		var width = $('.width_initial').val();
    		var height = $('.height_initial').val();
    
    		     $(".weight_additional").each(function() {
    		     	$(this).val(weight);
    		     });
    
    		     $(".depth_additional").each(function() {
    		     	$(this).val(depth);
    		     });
    
    		     $(".width_additional").each(function() {
    		     	$(this).val(width);
    		     });
    
    		     $(".height_additional").each(function() {
    		     	$(this).val(height);
    		     });
    
    		return false;
    	});
    
    });

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.