How to get the value of the multi-select box value in a post in SpringMVC (code example)

亚连
Release: 2018-06-12 20:20:38
Original
3070 people have browsed it

Now I will share with you an article about the value of the post checkbox multi-select box value in SpringMVC (hidden field method). It has a good reference value and I hope it will be helpful to everyone.

I pass the value of the checkbox multi-select box to the backend through a string. First, I call js to traverse the selected checkbox to obtain the selected box value, then write it into the hidden field, and finally write the composition object. Property submission. See code: `

Frontend:

  ${deploy.systemName} 
//实际存储的值,此处隐藏 //实际存储的值,此处隐藏 //调用脚本,给需要post的数据赋值

返回

Copy after login

Script:

Copy after login

Backend:

@RequestMapping(value = "editaccesscontrol", method = RequestMethod.POST) //后端方法, public String editAccessControlPost(User user,ModelMap model ) {//接收参数对象user userMapper.updateUserAccessControl(user); model.addAttribute("user",user); model.addAttribute("success", "权限修改成功"); return "redirect:/user/editaccesscontrol?id="+user.getId(); }
Copy after login

The above article briefly talks about the post checkbox multi-select box value in SpringMVC (hidden field method) is what I share with you. All the content

Related articles:

How to upload and compress images in js (detailed tutorial)

How to use vue Implementing CSS transition effects

How to use WeChat applet to implement image upload function

The above is the detailed content of How to get the value of the multi-select box value in a post in SpringMVC (code example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!