0

Using a classic html select code Brasil as defaut option could be selected using selected parameter:

   <option value="África do Sul">África do Sul</option>
    <option value="Brasil" selected>Brasil</option>
    <option value= ............... </option>
</select>

I'm using the dropdown of P&T Field Pack, it's working fine, a Channel Field element implement the dropdown list:

 <select>
     {options:member_paises}
           <option value="{option_value}"{selected}>{option_value}</option>
      {/options:member_paises}
</select>

But how to set Brasil, (or other option) as defaut option, like the classic html select code ??

thanks

  • 1
    I don't have test install under my hand but try next: <select> {options:member_paises} <option value="{option_value}" {if '{options:member_paises}' == '' && '{option_value}' == 'Brasil'}selected{/if}>{option_value}</option> {/options:member_paises} </select> – Max Lazar Aug 16 '14 at 7:47
  • Max, very nice solution, it's working fine, thanks a lot! If you want, you could put your reply as a answer. regards, stéphane – Stéphane Aug 16 '14 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.