The <select> tag has a property of multiple, and when set multiple= "true", you can hold the CTRL key on the page to make multiple selections, and in action you can give a string array to get the foreground value, as in the example below:
The Set/get method is given in the action. It is then added to the object based on the fields in the database.
But when the data is modified, a comma-delimited string is found from the database, so some processing needs to be done before echoing.
S1 is a JSON object that returns to the foreground in the background, splitting the string from the database by commas, and then getting the <select>.
Loop ratio, so that the data echo of multiple choices can be achieved.
Small white for the first time to write Weibo, we do not take offense, just want to accumulate the knowledge of the ordinary, well, the first article on this.
<select> data echo when multi-select