Jump to content

[SOLVED] Set default item selected in html select tag on .tpl file


GT ITECH

Recommended Posts

Hello, i want to make a normally "simple" thing but i don't know how to do that in prestashop .tpl file ^^

 

There is the code in my .tpl file :

<h4>{l s='Customization settings' mod='customization'}</h4>
<div class="separation"></div>
<table>
	
	<tr>
		<td class="col-left">
			<label>{l s='Customization is active : '}</label>
		</td>
		<td>		
				 <select id="activep_field" name="activep_field" style="width: 60px;">
					<option value="yes" selected="selected">{l s='Yes'}</option>
					<option value="no">{l s='No'}</option>
</select> 

{$activep}
			

				
			<p class="preference_description">{l s='Choose if customization is active on this product'}.</p>
		</td>
	</tr>
	
	
	
	
	
	
</table>

In this code, the smarty var $activep contain the value of the setting (stored in DB), actual value is "no" but i don't know how to make the select tag activep_field that select by default the option who have the same value than the $activep var.

 

Thank in advance for your help :)

 

Edited by GT ITECH (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...