2

I have a main page that have a list of categories and it loads a content of another page in a Div with the value of the selected row:

function edit_category(){
    guid_category = $("#guid_row_category").attr("value");
    if (guid_category == '')
    {
        alert('<?php echo $lang['NO_FILA']; ?>');   
    }
    else
    {       
        $("#edit_category").css('z-index',205);
        $("#edit_category").css('opacity',1);               
        $.ajax({ url: 'scripts/edit_category.php',
            data: {guid_category: guid_category},
            type: 'post',
            success: function(output) {
                document.getElementById("edit_category").innerHTML = output;
            }
        });
    }
}

The page I load (edit_category.php) has a color picker that needs to be loaded like this:

$(document).ready( function() {
            $('#inline_editar').minicolors();
});

When I try to load the (edit_category.php) page directly, the color picker Works correctly, but when I try to load it on the main page it doesn't work.

Any clues on how can I solve this?

Thank you.

Davylink
  • 21
  • 4
  • May be problem with you are having duplicate `id="edit_category"` after put it in main page. One in master page and One in inner Page. – Parth Trivedi Jan 12 '16 at 11:53
  • 1
    http://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml – Musa Jan 12 '16 at 11:58
  • The edit_category.php page doesn't have any element with a duplicate id, but thank you anyways. – Davylink Jan 12 '16 at 11:58

0 Answers0