Some PHP code that is really confusing me.?

JDL12345

New member
I have a select box that is programmed 'onchange' to submit the form it is in, but the issue I have is that there is no 'action' in the code so how does the form know where to go?! The code does work and changes all prices on the site to the other currency so it is going somewhere but I need to work out where so that I can troubleshoot an issue. Very confusing.

The html/PHP code is:

<form name="prc" id="prc" action="" method="post">
<select name="ptype" onchange="ptemp();">
<option value="gbp" <? if($_SESSION['ptype']=="gbp"){?> selected="selected"<? } ?>>UK Pound (GBP) **</option>
<option value="euro" <? if($_SESSION['ptype']=="euro"){?> selected="selected"<? } ?>>Euro (EUR) **</option>
</select>
</form>

The javascript function to submit the form is:

<script>
function ptemp()
{
document.prc.submit();
}
</script>
Thanks for the answer below. I still don't understand as there is no code in the hosting page that will do anything with the form.
 
Back
Top