I have multiple options like this :
<li>
<a href="#" title="" class="selected"><span class="to-admin">Administrator</span></a>
<input id="shareto" type="hidden" value="0-1" name="shareto">
</li>
<li>
<a href="#" title=""><span class="to-finance">Finance</span></a>
<input id="shareto" type="hidden" value="1-1" name="shareto">
</li>
<li>
<a href="#" title=""><span class="to-technician">Technician</span></a>
<input id="shareto" type="hidden" value="1-0" name="shareto">
</li>
<li>
<a href="#" title=""><span class="to-lawyer">Legal</span></a>
<input id="shareto" type="hidden" value="0-0" name="shareto">
</li>
and now I want to ‘catch’ that variable using this PHP :
$Type = $_POST['shareto'];
why I always get the last value, no matter what option I choose? how to do it correctly? thanks before.
Please check this working fiddle link http://jsfiddle.net/7GHug/
I think you want something like this.
Javascritp
With single hidden input you can update the value based on the clicked li.