nimonogi Posted April 5, 2010 Share Posted April 5, 2010 Hello, Any help will be greatly appreciated... I want the following form to change both language and currency when user change the selected currency. Original form - changes currency: <form method="post" action="{php}echo $_SERVER["REQUEST_URI"];{/php}"> <p class="header">{$LANG.choosecurrency}</p> <p> <select name="currency" onchange="submit()">{foreach from=$currencies item=curr} <option value="{$curr.id}"{if $curr.id eq $smarty.session.currency} selected{/if}>{$curr.code}</option> {/foreach}</select> <input type="submit" value="{$LANG.go}" /> </p> </form> Modified form - changes currency and language - not working: <form method="post" action="{php}echo $_SERVER["REQUEST_URI"];{/php}"> <p class="header">{$LANG.choosecurrency}</p> <p> <select name="currency" onchange="submit()">{foreach from=$currencies item=curr} <option value="{$curr.id}&language=lang{$curr.id}"{if $curr.id eq $smarty.session.currency} selected{/if}>{$curr.code}</option> {/foreach}</select> <input type="submit" value="{$LANG.go}" /> </p> </form> Expected result: "?currency=2&language=lang2" Any ideas on how to do this? Needed files are already created and working fine when i'm visiting "domain.com/?currency=2&language=lang2". Thanks. 0 Quote Link to comment Share on other sites More sharing options...
nimonogi Posted April 5, 2010 Author Share Posted April 5, 2010 I have found this solution which is working: <select name="currency" onchange="window.location.href='?currency='+this.options[this.selectedIndex].value+'&language=lang'+this.options[this.selectedIndex].value;"> Any suggestion/comment? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.