HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/self/root/proc/self/cwd/pm/plugins/Purchase/assets/js/vendor_portal/item_js.php
<script>
(function($) {
    "use strict";    
    $(".select2").select2();


	var addMoreAttachmentsInputKey = 1;
	$("body").on('click', '.add_more_attachments', function() {

	    if ($(this).hasClass('disabled')) {
	        return false;
	    }

	    var total_attachments = $('.attachments input[name*="attachments"]').length;
	    if ($(this).data('max') && total_attachments >= $(this).data('max')) {
	        return false;
	    }

	    var newattachment = $('.attachments').find('.attachment').eq(0).clone().appendTo('.attachments');
	    newattachment.find('input').removeAttr('aria-describedby aria-invalid');
	    newattachment.find('input').attr('name', 'attachments[' + addMoreAttachmentsInputKey + ']').val('');
	    newattachment.find($.fn.appFormValidator.internal_options.error_element + '[id*="error"]').remove();
	    newattachment.find('.' + $.fn.appFormValidator.internal_options.field_wrapper_class).removeClass($.fn.appFormValidator.internal_options.field_wrapper_error_class);
	    newattachment.find('svg').removeClass('feather-plus').addClass('feather-x').html('<line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>');
	    newattachment.find('button').removeClass('add_more_attachments').addClass('remove_attachment').removeClass('btn-success').addClass('btn-danger');
	    addMoreAttachmentsInputKey++;
	});

	// Remove attachment
    $("body").on('click', '.remove_attachment', function() {
        $(this).parents('.attachment').remove();
    });
})(jQuery);  	
</script>