jbe/bsw@0: --[[-- jbe/bsw@0: ui.submit{ jbe/bsw@0: name = name, -- optional HTML name jbe/bsw@0: value = value, -- HTML value jbe/bsw@0: text = value -- text on button jbe/bsw@0: } jbe/bsw@0: jbe/bsw@0: 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. jbe/bsw@0: jbe/bsw@0: --]]-- jbe/bsw@0: jbe/bsw@0: function ui.submit(args) jbe/bsw@0: if slot.get_state_table().form_readonly == false then jbe/bsw@0: local args = args or {} jbe/bsw@0: local attr = table.new(attr) jbe/bsw@0: attr.type = "submit" jbe/bsw@0: attr.name = args.name jbe/bsw@0: attr.value = args.value or args.text jbe/bsw@0: return ui.tag{ tag = "input", attr = attr } jbe/bsw@0: end jbe/bsw@0: end