Retain dynamically created DropDown list's sel

2019-08-09 02:04发布

Can use the below question as a reference to explain the context: Populate one dropdown based on selection in another

On my page; after selecting the proper values from the dropdown lists and filling up a few text fields, the user submits the form.

The next page is for the confirmation, that asks the user whether he/she wants to edit the form.The edit button just takes back the user to the previous page (window.history.back()).

Now the problem is, every field on the page has retained the value that was filled by the user. Except the second dropdown list (dependent dropdown list).

Is there a way to fix this?

1条回答
对你真心纯属浪费
2楼-- · 2019-08-09 02:23

Without the context of your specific code, it's hard to answer well, but you should look into using the window.sessionStorage or window.localStorage to temporarily store data for persistence between pages in javascript.

查看更多
登录 后发表回答