JQuery - Add, Remove Attribute

function displayACCField(obj) {

        if ($('#radio-cost-center').is(':checked')) {
            $("#labelAccAssignment").html("Cost Center");

            $("#textAccAssignment").removeAttr("disabled");


            //call function showAccAssignment(type);
            $("#imgF4AccAssignment").attr("onClick", "showAccAssignment('k');");

            $('#imgF4AccAssignment').attr({
                alt: 'Select Account Assignment',
                title: 'Select Account Assignment',
                src: "../images/icon/icon-open.png"
            });
           
        }
        else if ($('#radio-internal-order').is(':checked')) {
            $("#labelAccAssignment").html("Order No.");

            $("#textAccAssignment").removeAttr("disabled");

            $("#imgF4AccAssignment").attr("onClick", "showAccAssignment('o');");

            $('#imgF4AccAssignment').attr({
                alt: 'Select Account Assignment',
                title: 'Select Account Assignment',
                src: "../images/icon/icon-open.png"
            });

        }
        else if ($('#radio-na').is(':checked')) {
            //$("#labelAccAssignment").html("Cost Center");
           
            $("#textAccAssignment").attr("disabled", "disabled");

            $("#imgF4AccAssignment").removeAttr("onclick");

            $('#imgF4AccAssignment').attr({
                alt: '',
                title: '',
                src: "../images/icon/icon-open-disable.png"
            });

        }
    }

Popular posts from this blog

SAP CPI - Loop Process Call with SuccessFactor (oData V2)

Setting IntelliJ IDEA to run Groovy Script

C# - BASE64 to Image