diff --git a/src/scriptform.py b/src/scriptform.py
index 5742ae8..8265334 100755
--- a/src/scriptform.py
+++ b/src/scriptform.py
@@ -681,7 +681,7 @@ class ScriptFormWebApp(WebAppHandler):
"password": u'',
"text": u'',
"select": u'',
- "checkbox": u'',
+ "checkbox": u'',
"radio": u'{3}
',
}
@@ -723,7 +723,10 @@ class ScriptFormWebApp(WebAppHandler):
checked = u'' # Check first radio option
input = u''.join(radio_elems)
elif field['type'] == 'checkbox':
- input = tpl.format(required, field['name'], field_value)
+ checked = ''
+ if field['name'] in form_values and form_values[field['name']] == 'on':
+ checked = 'checked'
+ input = tpl.format(required, checked, field['name'])
elif field['type'] == 'text':
rows = field.get('rows', 5)
cols = field.get('cols', 80)