I have this code:
<?php foreach ($_options as $_option) : ?>
<input id="xyys" type="hidden" name="xyys" value="<?php echo($_option['value']);echo ($_option['option_id']);?>" />
<?php if($_option['label'] != 'Corte'): ?>
<?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
<dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
<?php if (isset($_formatedOptionValue['full_view'])): ?>
<div class="truncated_full_value">
<dl class="item-options">
<dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
<dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
</dl>
</div>
<?php endif; ?>
</dd>
<?php else: ?>
<?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
<dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
<dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>>
<img id="fotop" name="fotop" height="100px" width="100px" src=""></img><?php echo Si; ?>
<?php if (isset($_formatedOptionValue['full_view'])): ?>
<div class="truncated_full_value">
<dl class="item-options">
<dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
<dd><img id="fotog" name="fotop" src=""></img><?php echo Si; ?></dd>
</dl>
</div>
<?php endif; ?>
</dd>
<?php endif;?>
<script type="text/javascript">
var hero;
if ( localStorage.getItem('xyys')) {
hero = localStorage.getItem('xyys');
}
else {
hero = '/MvV336/rn67r8+/DbWa7b+G/gqh8H4Tw2ReXw3P5Muav3fFfjz+vze9nzdEouli5fwlnlcrlyMuXnye8eHM7/pzYznGXvof1T9u6ziLvD6H9U/bukIfQ/qn7d0hD6H9U/bukI+D6nw/8o8fL7d/q+XSODH36H9U/bukcw+h/VP27pCH0P6p+3dIQ+h/VP27pCH0P6p+3dIQ+h/VP27pCH0P6p+3dIR//9k=';
localStorage.setItem('xyys',hero);
}
document.getElementById("fotop").src=hero;
document.getElementById("fotog").src=hero;
</script>
<?php echo ("hi!");?>
<?php endforeach; ?>
Basically Im trying to run a Javascript each time in the for each....
I know it runs thru it because "hi!" is shown but it only executes the Javascript once.
i want it to execute it during each run in the foreach. Why doesnt it do it?