@@ -130,7 +130,7 @@ def create_checkbox(text,id_attribute,options,classes="",required=0):
130
130
checkbox_html = '<p id="%s_options">%s</p>' % (id_attribute ,text )
131
131
for n in range (len (options )):
132
132
option_id = "%s_%s" % (id_attribute ,n )
133
- checkbox_html = '%s\n <label class="%s" for="checkbox-%s">\n <input type="checkbox" id="checkbox-%s" %s class="mdl-checkbox__input %s %s" name="%s_options" value="%s">\n <span class="mdl-checkbox__label">%s</span>\n </label>' % (checkbox_html ,class_names ,option_id ,option_id ,meta ,classes ,required ,id_attribute ,options [n ],options [n ])
133
+ checkbox_html = '%s\n <label class="%s" for="checkbox-%s">\n <input type="checkbox" id="checkbox-%s" %s class="mdl-checkbox__input %s %s" name="%s_options" value="%s">\n <span class="mdl-checkbox__label">%s</span>\n </label>' % (checkbox_html ,class_names ,option_id ,option_id ,meta ,classes ,required ,option_id ,options [n ],options [n ])
134
134
return "%s<br><br><br>" % (checkbox_html )
135
135
136
136
def base_textfield (text ,id_attribute ,box_text = None ):
@@ -313,9 +313,10 @@ def parse_validation(required_counts):
313
313
validation = "%s if ( state.stepIndex === %s ) {\n " % (validation ,page_number )
314
314
else :
315
315
validation = "%s else if ( state.stepIndex === %s ) {\n " % (validation ,page_number )
316
- validation = " %s if (($.unique($(' .page%s.required[type=number],.page3 .required:text' ).map(function(){return this.name })).map(function() {return $('[name*=' + this + ' ].required[type=number], [name*=' + this + ' ].required:text' ).filter(function() { return $(this).val();}).length > 0}).get().indexOf(false) != -1) || ($.unique($(' .page%s.required:not([type=number]):not(:text)' ).map(function(){return this.name })).map(function() {return $('[name*=' + this + ' ].required:checked' ).length > 0}).get().indexOf(false) != -1)){\n is_required($(' .page%s.required:not(checked)' ));\n return false;\n " % (validation , page_number , page_number , page_number )
316
+ validation = ' %s if (($.unique($(` .page%s.required[type=number],.page%s .required:text` ).map(function(){return $( this).attr(`meta-text`) })).map(function() {return $(`[meta-text*="` + this + `" ].required[type=number], [meta-text*="` + this + `" ].required:text` ).filter(function() { return $(this).val();}).length > 0}).get().indexOf(false) != -1) || ($.unique($(` .page%s.required:not([type=number]):not(:text)` ).map(function(){return $( this).attr(`meta-text`) })).map(function() {return $(`[meta-text*="` + this + `" ].required:checked` ).length > 0}).get().indexOf(false) != -1)){\n is_required($(` .page%s.required:not(checked)` ));\n return false;\n ' % (validation , page_number , page_number , page_number , page_number )
317
317
318
318
319
+
319
320
# If we are at the last page, passing validation should enable the submit
320
321
if page_number == pages [- 1 ]:
321
322
validation = '%s } else {\n expfactory_finished=true;\n ' % (validation )
0 commit comments