粘性复选框

发布于 2024-08-11 06:44:30 字数 402 浏览 3 评论 0原文

我正在尝试设置一个复选框(通过电子邮件发送)粘性。

为了确保发送空时不会出现问题,我使用了以下内容:

<input type="checkbox" name="something" value="1">

<input type="hidden" name="something" value="0">

我使用过以下内容:

<input type="checkbox" name="something" value="1" <?=(($_POST['something']=='1')?'checked="checked"':'')?>>

但它不起作用。 有人可以帮我吗?非常感谢弗朗西斯科

Ii am trying to make a checkbox (to send via email) sticky.

To make sure it doesn't make a problem when sent empty I used the following:

<input type="checkbox" name="something" value="1">

<input type="hidden" name="something" value="0">

I have used things such as:

<input type="checkbox" name="something" value="1" <?=(($_POST['something']=='1')?'checked="checked"':'')?>>

But it does not work.
Can someone please help me? Many thanks Francesco

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

御弟哥哥 2024-08-18 06:44:30

人们可以解释为“粘性”意味着用户无法取消选中该复选框。这可以使用 disabled="disabled" 属性来实现。

然而,顺便说一句,强迫人们订阅某些电子邮件列表是不太礼貌的……

One could interpret that sticky means that user cannot uncheck the checkbox. That would be achieved using disabled="disabled" attribute.

As a side note, however, it wouldn't be very polite to force people to subscribe to some email list...

丑疤怪 2024-08-18 06:44:30

您的意思是已检查吗?
如果是这样,那么它将是

希望我理解正确

Do you mean checked?
If so then it would be

<input type="checkbox" name="something" value="1" checked="checked" />

Hope I understood that correctly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文