I have the following script and I am trying to disable the remove, move up and down buttons if only one row is present. Could someone show me how to do this please, I am stuck?
Can anyone show me how to add incremental names to a select field using the scrip below?
Thank You
<script>
$('.addnew').live('click', function(){
var thisRow = $(this).parent().parent();
newRow = thisRow.clone(true).insertAfter(thisRow);
newRow.find('input:not(.add)').val("");
newRow.find('.remove').show();
newRow.find('input.increment').val(parseInt(thisRow.find('input.increment').val())+1);
});
$('.remove').live('click', function(){
$(this).parent().parent().remove();
});
$('.up,.down').click(function () {
var row = $(this).parents('tr:first');
if ($(this).is('.up')) {
row.insertBefore(row.prev());
}
else {
row.insertAfter(row.next());
}
});
</script>