Вот весь js.
Остальной php как раз и не переедает переменных.
<script type="text/javascript">
function onChange(_this){
var pointofdel = _this.value;
switch (pointofdel)
{
case '21':
document.getElementById("pointofdeliveryl").style.display="block";
document.getElementById("pointofdeliveryl").innerHTML="<div>Адрес раздачи<?php echo weborder::deliveryaddresseshands($dataItem->pointofdelivery);?></div>";
break
case '1':
document.getElementById("pointofdeliveryl").style.display="block";
document.getElementById("pointofdeliveryl").innerHTML="<b>Типа адрес склада.</b>";
break
case '20':
document.getElementById("pointofdeliveryl").style.display="block";
document.getElementById("pointofdeliveryl").innerHTML='<div><input class="text_area" type="text" name="pointofdelivery" id="pointofdelivery" size="32" maxlength="255" value="<?php echo htmlspecialchars($dataItem->pointofdelivery, ENT_COMPAT, 'UTF-8');?>"/></div>';
break
case '0':
break
default:
document.getElementById("pointofdeliveryl").style.display="block";
document.getElementById("pointofdeliveryl").innerHTML='<div><input class="text_area" type="text" name="pointofdelivery" id="pointofdelivery" size="32" maxlength="255" value="<?php echo htmlspecialchars($dataItem->pointofdelivery, ENT_COMPAT, `UTF-8`);?>"/></div>';
break
};
};
</script>