libs/cbi: Prevent SimpleForms from prematurely parsing form data
authorSteven Barth <steven@midlink.org>
Thu, 14 Aug 2008 22:18:46 +0000 (22:18 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 14 Aug 2008 22:18:46 +0000 (22:18 +0000)
libs/cbi/luasrc/cbi.lua

index 3bb56f3..9996c84 100644 (file)
@@ -260,7 +260,9 @@ function SimpleForm.__init__(self, config, title, description, data)
 end
 
 function SimpleForm.parse(self, ...)
 end
 
 function SimpleForm.parse(self, ...)
-       Node.parse(self, 1, ...)
+       if luci.http.formvalue("cbi.submit") then
+               Node.parse(self, 1, ...)
+       end
                
        local valid = true
        for i, v in ipairs(self.children) do
                
        local valid = true
        for i, v in ipairs(self.children) do