|
|
@ -297,11 +297,18 @@ class ScriptFormWebApp(RequestHandler): |
|
|
|
params['options'] = field['options'] |
|
|
|
params['options'] = field['options'] |
|
|
|
|
|
|
|
|
|
|
|
if field['type'] == 'checkbox': |
|
|
|
if field['type'] == 'checkbox': |
|
|
|
|
|
|
|
# Set default value from field definition |
|
|
|
params['checked'] = False |
|
|
|
params['checked'] = False |
|
|
|
if field['name'] in form_values and \ |
|
|
|
if 'checked' in field and field['checked']: |
|
|
|
form_values[field['name']] == 'on': |
|
|
|
|
|
|
|
params['checked'] = True |
|
|
|
params['checked'] = True |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Set value from submitted form if applicable |
|
|
|
|
|
|
|
if field['name'] in form_values: |
|
|
|
|
|
|
|
if form_values[field['name']] == 'on': |
|
|
|
|
|
|
|
params['checked'] = True |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
params['checked'] = False |
|
|
|
|
|
|
|
|
|
|
|
h_input = fr_inst.r_field(field['type'], **params) |
|
|
|
h_input = fr_inst.r_field(field['type'], **params) |
|
|
|
|
|
|
|
|
|
|
|
return fr_inst.r_form_line(field['type'], field['title'], |
|
|
|
return fr_inst.r_form_line(field['type'], field['title'], |
|
|
|