jcf
jcf copied to clipboard
Ajax loading
Scenario In a page there is select defined with this code
<select>
<option hidden selected>Choose Option</option>
</select>
<a href="redirect.php">Go to this page</a>
var customSelect = $('select');
// Options for custom Select
jcf.setOptions('Select', {
wrapNative: false,
wrapNativeOnMobile: false,
fakeDropInBody: true
});
jcf.replace(customSelect);
jcf.refresh();
Other options are loaded via ajax. Next to select there is link which redirects to new page
Issue After selecting a value loaded via ajax and click on the link the page redirects and coming back from that page via browser back button, select doesn't show Choose Option value in the dropdown. Only the JCF tags are generated.
Does your code work without jcf? I mean, does native select works fine on back button?
Yes
Try to refresh jcf then. Its hard to fix the issue without seeing this issue in the browser.