Hi Guys
I'm no Javascript guru, although am fairly confidant using PHP... What I
have knocked together here uses PHP to create a querystring without the
iso=XX value, and dump it's output within some Javascript code.
The reason for this script is to reload a page with their country settings
(i.e. state for us but not for uk) on the form. If iso=uk is already in the
querystring we want to strip this from the querystring and use the
'iso_val'.
<script language="JavaScript" type="text/JavaScript">
function reloadCountry(fe) {
var opt_key = fe.selectedIndex;
var iso_val = fe.options[opt_key].value;
window.open('?iso=' + iso_val + '<?
foreach($_GET as $k => $v) {
if ($k != 'iso') {
$string .= "&$k=$v";
}
}
echo $string;
?>','_top');
return true;
}
</script>
How do I do this without the PHP?? I'm starting to use template engines such
as smarty and the PHP code is getting in the way of this.
I'm sure there is a simple solution, but any advice would be greatly
appreciated.
Many Thanks
Alex
--
"Big boast, small roast."