Multi Step setting values in dropdown, but not selected
-
In the JavaScript, when your filling in the forms from the cookie / session storage, you select the value of the drop down by
field.val(val);
, but any JavaScript that looks for selected values won’t be able to find the values in the filled in dropdown because your not adding selected.I’m not sure if it’s the most efficent way of doing it, but in your cf7msm.js I changed
if (field.length > 0) { if ( field.prop('type') == 'radio' || field.prop('type') == 'checkbox' ) { field.filter(function(){ return $(this).val() == val; }).prop('checked', true); } else { field.val(val); } }
to
if (field.length > 0) { if ( field.prop('type') == 'radio' || field.prop('type') == 'checkbox' ) { field.filter(function(){ return $(this).val() == val; }).prop('checked', true); } else if ( field.prop('type') == 'select-one' ) { field.find("*[value='"+val+"']").attr('selected', 'selected'); } else { field.val(val); } }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Multi Step setting values in dropdown, but not selected’ is closed to new replies.