I have this form witch contains a hidden field and a button inside of a function which i want to trigger an ajax db remove but i can't seem to make it work.
$this->_calendar .= '<td class="user_data" id="'. $data[0]->id .'" style="background-color: '. $color[0]->color .';">
<div class="userbox" id="'.$data[0]->id.'">
<form action="schedule.php?page=management&ajax=true" method="post">
<input type="hidden" name="id" value="'. $data[0]->id .'">
<input type="submit" name="remove_entry" value="x" class="ajax_bnt" style="vertical-align:bottom;overflow:visible; font-size:1em; display:inline; margin:0; padding:0; border:0; border-bottom:1px solid blue; color:blue; cursor:pointer;">
</form>
</div>
</td>';
And this is the js file
$(document).ready(
function () {
$('.ajax_btn').click( function() {
$.post("schedule.php?page=management&ajax=true", { id : $('#id').val() }, function (data) {
$('#remove_feedback').html(data);
}
);
});
});
The problem is that when i click the 'x' button it doesn't trigger the jquery code, its processed using the normal method.
Do you guys have any suggestions? I'm struggling to work my head around the js part but i've hit this roadblock.