您的位置:首页 > 其它

freemarker ftl 文件中写radio单选框select 下拉框并且带if条件判断

2011-09-15 14:34 966 查看
<#list themes as t>

<#switch t.id>

<#case "default">

<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">蓝色主题

<#break>

<#case "gdocs">

<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">淡蓝主题

<#break>

<#case "greenTheme">

<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">绿色主题

<#break>

<#case "hcBlack">

<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">黑色主题

<#break>

<#case "yellowTheme">

<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">***主题

<#break>

<#default>

<input name="console-options-theme-menu" type="radio" <#if t.selected> checked </#if> value="${t.id}">${t.title?html}${t.id?html}1

</#switch>

</#list>

下拉框

<select id="console-options-theme-menu">

<#list themes as t>

<#switch t.id>

<#case "default">

<option value="${t.id}"<#if t.selected> selected="selected"</#if>>蓝色主题</option>

<#break>

<#case "gdocs">

<option value="${t.id}"<#if t.selected> selected="selected"</#if>>淡蓝主题</option>

<#break>

<#case "greenTheme">

<option value="${t.id}"<#if t.selected> selected="selected"</#if>>绿色主题</option>

<#break>

<#case "hcBlack">

<option value="${t.id}"<#if t.selected> selected="selected"</#if>>黑色主题</option>

<#break>

<#case "yellowTheme">

<option value="${t.id}"<#if t.selected> selected="selected"</#if>>***主题</option>

<#break>

<#default>

<option value="${t.id}"<#if t.selected> selected="selected"</#if>>${t.title?html}${t.id?html}1</option>



</#switch>

</#list>

</select>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: