Template:EditButton/CheckList

From Metabolomics.JP
< Template:EditButton(Difference between revisions)
Jump to: navigation, search
Line 24: Line 24:
 
     body = string.sub(list[i],string.len(head)+1);
 
     body = string.sub(list[i],string.len(head)+1);
 
     --%% あらかじめセットしてあるデータをチェック - データは"、"区切り %%--
 
     --%% あらかじめセットしてあるデータをチェック - データは"、"区切り %%--
     if (string.match("{{#get:initset}}", "[、^]" .. body .. "[、$]", 0) == nil) then
+
     if (string.match("{{#get:initset}}", "、" .. body .. "、", 0) ~= nil or
    checked = ''  
+
        string.match("{{#get:initset}}", "^" .. body .. "、", 0) ~= nil or
 +
        string.match("{{#get:initset}}", "、" .. body .. "$", 0) ~= nil)
 +
      checked = ' checked="yes"'  
 
     else
 
     else
       checked = ' checked="yes"'
+
       checked = ''
 
     end
 
     end
 
     print(head .. '{{#form' .. 'tag:input|type="checkbox" value="' .. body .. '" name="list[]" id="' .. body .. '"' .. checked .. '}}{{#form' .. 'tag:label|for="' .. body .. '"|' .. body .. '}}<br>')
 
     print(head .. '{{#form' .. 'tag:input|type="checkbox" value="' .. body .. '" name="list[]" id="' .. body .. '"' .. checked .. '}}{{#form' .. 'tag:label|for="' .. body .. '"|' .. body .. '}}<br>')

Revision as of 13:18, 9 April 2009

./lua: /tmp/mw_ex_lua_5Mdei5:23: 'then' expected near 'checked'

Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox