hello

I have been developing a code for changing currency on onclick

here is a demo code

<form id="setCurrency" action="{$request_uri}" method="post">
		<select name="language" class="language">
        <option value="">Select Currency</option>
			{foreach from=$currencies key=k item=f_currency}
            
            
<option value="{$f_currency.name}" OnClick="location.href='javascript:setCurrency({$f_currency.id_currency})';">{$f_currency.sign}{$f_currency.name}</option>

            
				
			{/foreach}</select>
	
	
				<input type="hidden" name="id_currency" id="id_currency" value=""/>
				<input type="hidden" name="SubmitCurrency" value="" />
			
		
	</form>

..........................

It works fine for firefox but not for all browser

Change location.href='javascript:setCurrency({$f_currency.id_currency})'; to just setCurrency({$f_currency.id_currency}); .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.