html - Boolearn logic in Python CGI script -
does know how set html check box true or false python. using python file parse xml file list. list want check checkbox if text in xml tag 1 or want remain unchecked if the text in xml tag 0.
thsi being done cgi file, don't ask why. is. can't use frameworks device small amount of memory.
the list have parses xml file list, part works.
<label class="checkbox inline control-label"><input name="l10" value="l10" checked="checked" type="checkbox" <span> l10 </span></label> <label class="checkbox inline control-label"><input name="l05" value="1" type="checkbox" checked/> <span> l5 </span></label>
can like:
if config_settings.settings[11] == '1': true
or put logic html form like:
<label class="checkbox inline control-label"><input name="l05" if config.settings.settings[11] == '1': <input name="l05" value="1" type="checkbox" checked/>
any appreciated.
i shown solution using php similiar. answer worked me in end simple enough. changed setting in xml file 1 or 0 true or false , did this:
if config_settings.settings[5] == '1': print'''<html><label class="checkbox inline control-label"><input name="aweight" value="1" type="checkbox" checked/></html>''' else: print'''<html><label class="checkbox inline control-label"><input name="aweight" value="1" type="checkbox"/></html>'''
the html inside python cgi script.
Comments
Post a Comment