summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua14
-rw-r--r--modules/luci-base/luasrc/view/cbi/simpleform.htm3
2 files changed, 11 insertions, 6 deletions
diff --git a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
index f1adae2854..83011e9dd5 100644
--- a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
+++ b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
@@ -34,15 +34,19 @@ end
wssid.datatype = "rangelength(1,32)"
wssid.default = m.hidden.ssid or ""
-bssid = m:field(Value, "bssid", translate("BSSID"),
- translatef("The BSSID information '%s' is optional and only required for hidden networks", m.hidden.bssid or ""))
-bssid.datatype = "macaddr"
+nobssid = m:field(Flag, "no_bssid", translate("Ignore BSSID"))
if m.hidden.ssid == "" then
- bssid.default = m.hidden.bssid or ""
+ nobssid.default = nobssid.disabled
else
- bssid.default = ""
+ nobssid.default = nobssid.enabled
end
+bssid = m:field(Value, "bssid", translate("BSSID"),
+ translatef("The BSSID information '%s' is optional and only required for hidden networks", m.hidden.bssid or ""))
+bssid:depends("no_bssid", 0)
+bssid.datatype = "macaddr"
+bssid.default = m.hidden.bssid or ""
+
if (tonumber(m.hidden.wep) or 0) == 1 then
encr = m:field(ListValue, "encryption", translate("Encryption"))
encr:value("wep", "WEP")
diff --git a/modules/luci-base/luasrc/view/cbi/simpleform.htm b/modules/luci-base/luasrc/view/cbi/simpleform.htm
index 78f5c5a544..3b758d70ee 100644
--- a/modules/luci-base/luasrc/view/cbi/simpleform.htm
+++ b/modules/luci-base/luasrc/view/cbi/simpleform.htm
@@ -52,7 +52,8 @@
<%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%>
" />
<% end %>
- <script type="text/javascript">cbi_d_update();</script>
</div>
</form>
<% end %>
+
+<script type="text/javascript">cbi_init();</script>