libs/cbi: auto-select appropriate option if create field is focused
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 8 Oct 2009 00:46:01 +0000 (00:46 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 8 Oct 2009 00:46:01 +0000 (00:46 +0000)
libs/cbi/luasrc/view/cbi/firewall_zonelist.htm

index 7474b77be2aaec15dfbf5ecfdd62fc6a59569dc3..fb1f5e516de6d5ffe302b2e9c2b9ad670a7b643e 100644 (file)
@@ -54,7 +54,7 @@ $Id$
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not value, "checked", "checked")%> /> &nbsp;
                <div style="background-color:<%=fwm.zone.get_color()%>; padding:0.5em; display:inline">
                        <label<%=attr("for", cbid .. "_new")%>><em><%:a_s_ipt_zone_unspec_create unspecified -or- create:%>&nbsp;</em></label>
-                       <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone")%> />
+                       <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone")%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" />
                </div>
        </li>
 </ul>