[eluser]Andy UK[/eluser]
Hi guys,
I have the MY Language extension installed which enables me to run a multilingual site using the
Code:
echo lang('keyword')
function in my views which reference a couple of translation files that hold the keywords and their various translations.
All is working fine except for when a user decides to change the language in the middle of a search results page. That is to say that a form has been submitted and the results of the db search are on the screen.
Now while i am able to capture the form $_POST values in hidden fields, i can't figure out how to both resubmit the form and also change to the requested language.
The code for changing the language to English is something like this:
Code:
echo anchor($this->lang->switch_uri('en'),'<img src="/resources/british_flag.png" />'
Whereas to resubmit the form i use:
Code:
<a ref='script:document.resubmitForm.submit();'><img src='/resources/british_flag.png' /></a>
(form is name resubmitForm. href has been re-written as 'ref' and javascript rewritten as 'script' to avoid them being stripped from the post)
How can i achieve both a language change and a form resubmission? Any elegant solution would be much appreciated!
Thanks!