I have a recordset with an “edit” button next to them. I also have a div that has a form inside it.
when I click "edit", I show the div. Inside the div, I have a close button that just closes the div through jquery.hide (). when I then click the "Edit" button for another record, the div is not displayed at all.
I use a different show and hide other elements in my code, and they work very well. Only I can’t work.
Is there a specific use of the show () and hide () methods in my case?
$('.edit').live('click', function() {
var theid = $(this).attr('id');
$('#' + theid).empty().append($('.rec_edit').show());
if ($('#txt_nowediting_id').val() > 0) {
load_single_rec($('#txt_nowediting_id').val());
};
$('#txt_nowediting_id').val(theid);
return false;
});
$('#btnCancelEdit').click(function() {
$('.rec_edit').hide();
load_single_rec($('#txt_nowediting_id').val());
return false;
});
here .rec_edit is a div that is hidden and displayed ...
source
share