从多个选择中保存值 [英] save values from multiple select

查看:94
本文介绍了从多个选择中保存值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究jsp和struts2。单击选中的值将在单击按钮时填充。但是在数据库中,值只有一列。所以我必须用逗号分隔单列中的所有值。另外,在编辑模式下,必须将值检索到同一个选择框中。可以帮忙吗?在此先感谢:)

I am working on jsp & struts2. The values in the select are populated on click of a button. But in the database there is only a single column for the values. SO I have to save all the values in single column seperated with commas. Plus in the edit mode have to retrieve the value into the same select box. Can any help?? Thanks in advance :)

推荐答案

这可以帮助 [< a href =http://www.jqueryrain.com/?iF5ue7jrtarget =_ blanktitle =New Window> ^ ]



有一个名为jQuery的库,它有很多插件,这是一个这样的插件,它正是你所要求的(再次,我希望我能理解你)。
This can help[^]

There is a library called jQuery which has loads of plugins, this is one such plugin which does exactly what you are asking (again, I'm hoping i've understood you).


你犯了一个严重的错误。

永远不要在一行中放入多个值。它可以但不应该这样做。这是违反1NF原则的。在关系数据库设计中,每一行都不能有一个具有多个值的列,例如用逗号分隔。它们应分成多行。

了解更多:十个共同数据库设计错误/ [ ^ ]
You are making a serious mistake.
Never put multiple values in a single column in a row. It can but should not be done. It is against 1NF principle. In relational database design, every row must not have a column that takes more than one value, like separated with commas. They should be separated into multiple rows.
Read more: ten-common-database-design-mistakes/[^]


这篇关于从多个选择中保存值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆