In my cms I have a checkbox group for categories. I would like to have a text input below that where the user can input the name of a new category and it will dynamically ad
One of the elements to consider as you design your interface is on what event (when A takes place, B happens...) does the new checkbox end up being added?
Let's say there is a button next to the text box. When the button is clicked the value of the textbox is turned into a new checkbox. Our markup could resemble the following...
Some label
Some other label
Based on this markup your jquery could bind to the click event of the button and manipulate the DOM.
$('#addCheckbox').click(function() {
var text = $('#newCheckText').val();
$('#checkboxes').append(' ' + text + '
');
});