保留 while() 生成的复选框字段列表的值。值=“已检查” (但价值已经有数据了?)
我在这里有点奇怪。我正在修改一个脚本,除了我的复选框输入选择是从带有 while
循环的数组生成的之外,我的验证一切正常。
我需要做的是保留value="checked"
如果该框已被选中,但 value 字段当前存储要传递到表的 id 值,并且 value 选项是如何调用“checked”的。 ..所以
...PHP_SELF...
while(...)
{
<input name="seminar[]" type="checkbox" id="seminar[]" value="<?= $data[id] ?>">
}
...SUBMIT...
我想我可能需要将提交的值存储在数组中,然后将 value=""
替换为 value= “已检查”
但对我来说似乎有点奇怪..
有人遇到过这个之前有建议吗?
I'm in a bit of an odd spot here. I am modifying a script, and my validation is all working fine with the exception of my checkbox input selections which are generated from an array with a while
loop..
What I need to be able to do is retain the value="checked"
if the box has been selected, but the value field currently stores the id value to be passed to a table, and I the value option is how the "checked" is called... So
...PHP_SELF...
while(...)
{
<input name="seminar[]" type="checkbox" id="seminar[]" value="<?= $data[id] ?>">
}
...SUBMIT...
I am thinking I might need to store the submitted values in an array, then replace the value="<?= $data[id] ?>"
with value="checked"
but seems kinda wonky to me..
Anyone run into this before have an suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这个问题。我没有意识到这一点,但是有一个标题为:checked 的输入值,其工作原理如下:checked="checked" ..天哪,这让我处于我的位置:)
I solved this. I did not realize this, but there is an input value titled: checked which works like: checked="checked" .. Geeze this put me in my place : )