Hello,
i have ajax that post URL.
What i want to do is switch months inside a modal
it works in simple php file but does not work in my modal
My script:
<script>
$('#submit_formz').click(function(e){
e.preventDefault(); // Prevent Default Submission
$.ajax({
url: 'page_machinery_planning_child',
type: 'GET',
data: $(this).serialize(), // it will serialize the form data
dataType: 'html'
})
.done(function(data){
$('#form-content').fadeOut('fast', function(){
$('#form-content').fadeIn('fast').html(data);
setTimeout(
function(){
$('.ui.modal').modal('refresh');
}, 1);
});
})
.fail(function(){
alert('Ajax Submit Failed ...');
});
});
</script>
PHP:
if(!$date){$date=date('Y-m-d');}else{$date=$date;}
$next_month = date('Y-m-d', strtotime("+1 months", strtotime(date('Y-m-01',strtotime($date)))));
$prev_month = date('Y-m-d', strtotime("-1 months", strtotime(date('Y-m-01',strtotime($date)))));
echo '
<table><tr>
<td align="right" id="submit_formz2"><a href="page_machinery_planning_child.php?date='.$next_month.'"> >> </a>
</tr></table>';
Any tips for whats wrong?
Thanks