$(document).ready(function()
{
    var numberType = $("select[name='customfield["+voiceTypeId+"]']").val();

    //----onload event----

    if(numberType=="New Number")
    {
        $("input[name='customfield["+voiceExistingId+"]']").attr("disabled","disabled");
        $("#voiceModal").modal("hide");
    }
    else
    {
        $("input[name='customfield["+voiceExistingId+"]']" ).removeAttr("disabled");

        $("#voiceModal").modal();
    }

    //---onchange event----

    $("select[name='customfield["+voiceTypeId+"]']" ).change(function()
    {
        if($(this).val() === "New Number")
        {
            $("input[name='customfield["+voiceExistingId+"]']" ).attr("disabled","disabled");
            $("#voiceModal").modal("hide");
        }
        else
        {
            $("input[name='customfield["+voiceExistingId+"]']" ).removeAttr("disabled");
            $("#voiceModal").modal();
        }
    });
});