Hello. I make a script online recording time in php + javascript. When processing the html form, the data is sent by the POST method to the php file, processing is done there ... In addition, after clicking on the button, the value of the <option> tag that was selected is deleted. Written function and value is deleted, but after clicking on the button, the form is updated, which leads to the fact that the form takes the original form - all values ​​of <option> returned.

    2 answers 2

    There are several solutions: 1. Save information about the deleted option in a cookie and read this set of cookies when loading and remove those that are marked. 2. save this set on the server and rely on this information when generating the page

      In addition to the methods suggested by @ Chad , there is another way - to send data to the handler using Ajax. In this case, the page will not reload, so the deleted option elements will remain invisible until the page is forced to refresh.

      • Yes, I did not read it carefully, I thought that the problem is that after the user has updated the page, everything breaks down. I would suggest combining both options - updating by Ajax, and when rebooting, load only what you need - Chad