diff options
author | Natanael Copa <natanael.copa@gmail.com> | 2008-06-04 13:02:32 +0000 |
---|---|---|
committer | Natanael Copa <natanael.copa@gmail.com> | 2008-06-04 13:02:32 +0000 |
commit | 7bc745d79d2013e2610d1b802c4a12cbc7748a86 (patch) | |
tree | 933816d2657848eefd08a0be4042dfb5cccb1d97 /lib/viewfunctions.lua | |
parent | 7814c1ad996ab07b0c4d102b0ff0c808c2dd0570 (diff) | |
download | acf-core-7bc745d79d2013e2610d1b802c4a12cbc7748a86.tar.bz2 acf-core-7bc745d79d2013e2610d1b802c4a12cbc7748a86.tar.xz |
create a proper <label></label> if controls have an id defined
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1195 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/viewfunctions.lua')
-rw-r--r-- | lib/viewfunctions.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/viewfunctions.lua b/lib/viewfunctions.lua index d6b5061..3460764 100644 --- a/lib/viewfunctions.lua +++ b/lib/viewfunctions.lua @@ -3,12 +3,16 @@ function displayinfo(myform,tags,viewtype) for k,v in pairs(tags) do if (myform[v]) and (myform[v]["value"]) then local val = myform[v] + local label = val.label io.write("\n\t<DT") if (val.errtxt) then val.class = "error" io.write(" class='error'") end - io.write(">" .. val.label .. "</DT>") + if val.id then + label = "<label for=\"" .. val.id .."\">" .. val.label .. "</label>" + end + io.write(">" .. label .. "</DT>") io.write("\n\t\t<DD") if (val.errtxt) then val.class = "error" |