Question
All orders Valid order Canceled order Orders made three months ago Orders for the last three months
How can I refresh the option value on this page to save it?
Reply to discussion (solution)
Orders made three months ago
If it is returned after Submission (for example, filling in the error information again), add the corresponding value to the attribute
If the client is not submitted for refresh, write cookies in onchange. when loading the page, js reads the cookie and then changes the corresponding option.
Write the code by yourself. I haven't written JavaScript for many years.
You do not need to add attributes as long as you refresh and save his value ..
Ask questions clearly!
How is your logical process refreshed? Submit or manually refresh?
I submitted a form using js events to this page. because the option is refreshed, it will change back to the original format. I want to save the value of the last option.
Refresh means re-loading the page. of course, the previous selection is gone.
You do not set attributes actively. how can this problem be solved?
It is estimated that the request is submitted through ajax.
> All orders > Valid orders > Canceled orders > Orders made three months ago > Orders for the last three months
This is acceptable, but it is troublesome. it is best to submit it using ajax in this case.
I submitted a form using js events to this page. because the option is refreshed, it will change back to the original format. I want to save the value of the last option.
It is best to submit it via ajax, so that the page is not refreshed at all, and the option will not change.
If a form is submitted, the submitted option value will be transferred when the page submission operation is completed and then redirected back (the premise is that you need to determine whether the submitted page value exists on the single page of the table, if the option value is set to "selected", the option is selected by default)
There is also a small problem. when I went in, I couldn't find the subscript.
> All orders
> Valid orders
> Canceled orders
> Orders made three months ago
> Orders for the last three months
Learned