I'm new to PHP, I come from a C/C++ background and I have a problem that I've been stumbling on for a while now.
I have this piece of code in my html-file:
<div class="totaal clearfix">
<div class="border-left"></div>
<div class="content-totaal">
<h2 class="vk"><?php echo $locLocal["lbl_totaal"]; ?></h2>
<div class="totalekost" id="ajax_placeholder_total">
<span id="prijs_totaal">
<?php
$winkelwagentje->berekenTotaal();
?>
</span> EUR
</div>
</div>
<div class="border-right"></div>
A bit further, I have this piece of code which should update when a listdownbox on the page changes.
<script type="text/javascript">
$('cb_verzendoptie').observe('change', function(event)
{
var _verzendoptie = this.getValue();
new Ajax.Updater( 'ajax_placeholder_port', 'ajax/berekenVerzendingskosten.php',
{ parameters: { verzendoptie: _verzendoptie},
});
$('ajax_placeholder_total').update("<?php echo date(DATE_RFC822); ?>" + " EUR" );
});
I put the 'echo date(DATE_RFC822)' to test if the update actually triggers every time. And that's my problem, it doesn't. He echoes the date and time once, but from then the update doesn't trigger anymore for some kind of reason. The datetime stays the same.
The weird thing is, the Ajax.Updater method above this line does update every time my dropdownbox changes value. I really don't know why...
EDIT:
The date is just stubb data, instead of the date I normally need a php class there with a variable. The variable is updated in the Ajax.Updater method above the statement. But I doesn't change. That's why I tried to use the date, to see if the statement does update.