Hello,
I have a website with diffrent languages.
That is working perfect but I got a problem with a form…
I have a form that reloads on change and then the URL is different:
In my index I use this code:
[PHP]if(!isset($_GET[‘lang’]))
{
include “talen/nl.php”;
$lang = “nl”;
}
else
{
include “talen/”.$_GET[‘lang’].".php";
$lang = $_GET[‘lang’];
}[/PHP]
I have a Javascript file that is working like this:
"reloadForm" : function(form, merk, model)
{
var val = form.options[form.options.selectedIndex].value,
data = "";
if(merk != '')
{
data = data + "&merk=" + merk;
if(model != '')
{
data = data + "&model=" + model;
data = data + "&type=" + val;
}
else
{
data = data + "&model=" + val;
}
}
else
{
data = data + "&merk=" + val;
}
window.location = "index.php?lang=nl&p=9&search=wiel" + data + "#keuze";
}
Everywhere I can change language with onclick and href like this for example:
[PHP]
<a href="?lang=<?php echo $lang; ?>[/PHP]
No in my Javescript file above I manualy entered the language (lang=nl)
But I want to have this set dynamicly like the rest of my website…
How can I realise this because I’m stuck now
Thanks in advance!