$('<input>').attr({ type: 'hidden', id: 'foo', name: 'bar' }).appendTo('form');
console.log($("input:hidden[value='" + cat_id + "']").length > 0)