applications/luci-firewall: javascript & validation fixes in quickaction forms
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 9 Aug 2012 10:16:03 +0000 (10:16 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 9 Aug 2012 10:16:03 +0000 (10:16 +0000)
applications/luci-firewall/luasrc/view/firewall/cbi_addrule.htm
applications/luci-firewall/luasrc/view/firewall/cbi_addsnat.htm

index 473f9f4519951ce86cc7e0457f65a2b11f352d88..463b2e05f4990e57afdb77ec58115332076057a7 100644 (file)
@@ -73,7 +73,7 @@
                </table>
 
                <script type="text/javascript">//<![CDATA[
-                       cbi_validate_field('_newopen.extport', true, 'list(portrange)');
+                       cbi_validate_field('_newopen.extport', true, 'list(neg(portrange))');
                        cbi_bind(document.getElementById('_newopen.extport'), 'blur',
                                function() {
                                        var n = document.getElementById('_newopen.name');
index 28bb22d40ad4e3366c25ae41cf166f64f02bae3e..4e1681c11d9149279898ba556ba1ce6edac49b1a 100644 (file)
 
                <script type="text/javascript">//<![CDATA[
                        cbi_validate_field('_newsnat.dport', true, 'portrange');
+                       cbi_validate_field('_newsnat.dip', true, 'ip4addr');
                        cbi_combobox_init('_newsnat.dip', {
                                <% local c, k, v = 0; for k, v in ipairs(nw:get_interfaces()) do -%>
                                        <%- local a; for k, a in ipairs(v:ipaddrs()) do c = c + 1 -%>
-                                               <% if c > 1 then %>,<% end %>'<%=a:host():string()%>': '<%=a:host():string()%> (<%=v:shortname()%>)',
+                                               <% if c > 1 then %>,<% end %>'<%=a:host():string()%>': '<%=a:host():string()%> (<%=v:shortname()%>)'
                                        <%- end %>
                                <%- end %> }, '<%: -- Please choose -- %>', '<%: -- custom -- %>');
                //]]></script>