function deleteBlock(){
    // Delete the search condition row
    $(this).parent('.form-row').remove();

    // Initialize current row counter to "1"
    var curRow = 1;

    // After the chosen row is deleted, resequence fields
    $('#formfieldset div.search').each(function(){
        // Rename form fields to keep the sequencing correct
        $(this).find('select[name^="within"]').attr('name','within' + curRow);
        $(this).find('input[name^="term"]').attr('name','term' + curRow);

        // If the current row does not have the "Add" button
        // (because it was the last row), insert a new "Add" button
        if($(this).find('input[name="add_search"]').length == 0){
            // Identify the "Delete" button
            var $deleteObj = $(this).find('input[name="delete"]');

            // Insert an "Add" button and a spacer before the "Delete" button
            $('<span>&nbsp;</span>').insertBefore($deleteObj);
            $('<input>').attr({'type':'button','name':'add_search','class':'button'}).val('ADD').click(createBlock).insertBefore($deleteObj);
        }
        curRow++;
    });

    // Update the search criteria counter
    updateCriteria();
}
// Delete the selected row and resequence the remaining rows

Delete the selected row and resequence the remaining rows
Delete the selected row and resequence the remaining rows
function deleteBlock(){
    $(this).parent('.form-row').remove();
    var curRow = 1;
    $('#formfieldset div.search').each(function(){
        $(this).find('select[name^="within"]').attr('name','within' + curRow);
        $(this).find('input[name^="term"]').attr('name','term' + curRow);
        if($(this).find('input[name="add_search"]').length == 0){
            var $deleteObj = $(this).find('input[name="delete"]');
            $('<span>&nbsp;</span>').insertBefore($deleteObj);
            $('<input>').attr({'type':'button','name':'add_search','class':'button'}).val('ADD').click(createBlock).insertBefore($deleteObj);
        }
        curRow++;
    });
    updateCriteria();
}
function deleteBlock ( ) { $ ( this ) . parent ( '.form-row' ) . remove ( ) ; var curRow = 1 ; $ ( '#formfieldset div.search' ) . each ( function ( ) { $ ( this ) . find ( 'select[name^="within"]' ) . attr ( 'name' , 'within' + curRow ) ; $ ( this ) . find ( 'input[name^="term"]' ) . attr ( 'name' , 'term' + curRow ) ; if ( $ ( this ) . find ( 'input[name="add_search"]' ) . length == 0 ) { var $deleteObj = $ ( this ) . find ( 'input[name="delete"]' ) ; $ ( '<span>&nbsp;</span>' ) . insertBefore ( $deleteObj ) ; $ ( '<input>' ) . attr ( { 'type' : 'button' , 'name' : 'add_search' , 'class' : 'button' } ) . val ( 'ADD' ) . click ( createBlock ) . insertBefore ( $deleteObj ) ; } curRow ++ ; } ) ; updateCriteria ( ) ; }
Delete the selected row and resequence the remaining rows
Delete the selected row and resequence the remaining rows
// Delete the search condition row
 // Initialize current row counter to "1"
 // After the chosen row is deleted, resequence fields
 // Rename form fields to keep the sequencing correct
 // If the current row does not have the "Add" button
 // (because it was the last row), insert a new "Add" button
 // Identify the "Delete" button
 // Insert an "Add" button and a spacer before the "Delete" button
 // Update the search criteria counter
