webmcp
diff framework/env/ui/submit.lua @ 0:9fdfb27f8e67
Version 1.0.0
author | jbe/bsw |
---|---|
date | Sun Oct 25 12:00:00 2009 +0100 (2009-10-25) |
parents | |
children | 76ceed10d65b |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/framework/env/ui/submit.lua Sun Oct 25 12:00:00 2009 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +--[[-- 1.5 +ui.submit{ 1.6 + name = name, -- optional HTML name 1.7 + value = value, -- HTML value 1.8 + text = value -- text on button 1.9 +} 1.10 + 1.11 +This function places a HTML form submit button in the active slot. Currently the text displayed on the button and the value attribute are the same, so specifying both a 'value' and a 'text' makes no sense. 1.12 + 1.13 +--]]-- 1.14 + 1.15 +function ui.submit(args) 1.16 + if slot.get_state_table().form_readonly == false then 1.17 + local args = args or {} 1.18 + local attr = table.new(attr) 1.19 + attr.type = "submit" 1.20 + attr.name = args.name 1.21 + attr.value = args.value or args.text 1.22 + return ui.tag{ tag = "input", attr = attr } 1.23 + end 1.24 +end