I have drop down in pop up window where users can choose their country. I am using hidden field to submit choice with php and when I hit "submit" button I get the country which was chosen. Information about country is shown in the header so it should be on every page but when I start to browse between pages the country value dissapeares. How can I keep it on every page?
<div class="field">
<div class="input-box">
<?php $_countries = Mage::getResourceModel('directory/country_collection')->loadData()->toOptionArray(false); ?>
<?php if (count($_countries) > 0): ?>
<select name="country" id="country" onchange="print(this.value)">
<option value=""> </option>
<?php foreach($_countries as $_country): ?>
<?php if(!in_array($_country['value'], $arrNO)):?>
<option value="<?php echo $_country['value'] ?>" >
<?php echo $_country['label'] ?>
</option>
<?php endif;?>
<?php endforeach; ?>
</select>
<?php endif; ?>
</div>
<form action="" method="post">
<input id="choice" type="hidden" name="fname" value=""/>
<input type="submit" value="OK"/>
</form>
<div id="usWarning"><p><span class="red">NOTE</span>: If you live in <span class="red">Arizona</span>, <span class="red">Iowa</span>, <span class="red">Maryland</span>, <span class="red">Oklahoma</span>, <span class="red">South Dakota</span>, <span class="red">Vermont</span>, <span class="red">Washington</span> or <span class="red">Wisconsin</span>, we are unfortunately not allowed to sell tobacco to you. Its forbidden with online sales of tobacco in these states.</p></div>
</div>
"Value" for the hidden input field assigned with the help of JS:
function print(value) {
document.getElementById("choice").value=value;
}
Thank you for your help.