Laravel 6

Uncaught Error: Color picker already installed on this element

Avatar de MahmoudKhosravi
MahmoudKhosravi

What is this error?

error

I tried for solve it, in 3 days, But my problem did not solve yet.

addColor = function(){
    let html = '<div class="row no-gutters mb-1">\n'+
        '<div class="col-md-3">\n'+
        '<label for="color_name" class="ml-1">نام رنگ:</label>\n'+
        '<input type="text" id="color_name" name="color_name[]" class="form-control w-auto d-inline">\n'+
        '</div>\n'+
        '<div class="col-md-3">\n'+
        '<label for="color_code" class="ml-1">کد رنگ:</label>\n'+
        '<input type="text" id="color_code" name="color_code[]" class="form-control w-75 d-inline jscolor">\n'+
        '</div>\n'+
        '<div class="col-md-1">\n'+
        '<a onclick="addColor()" class="btn btn-info"><i class="fas fa-plus"></i></a>\n'+
        '<a onclick="deleteColor(this)" class="btn btn-danger"><i class="fas fa-times"></i></a>\n'+
        '</div>\n'+
        '</div>';
    new jscolor($('.jscolor').last()[0]);
    $('#showColors').append(html);
};

This error occurred in the following line.

new jscolor($('.jscolor').last()[0]);

My complete code is this.

https://i.stack.imgur.com/NIqVi.png

https://i.stack.imgur.com/0RLXG.png

https://i.stack.imgur.com/l8MBp.png

Posté il y a 2 ans

Vous ne pouvez pas répondre à ce sujet.