开发者

sticky checkbox

开发者 https://www.devze.com 2022-12-12 03:10 出处:网络
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:

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 开发者_如何学JAVAit does not work. Can someone please help me? Many thanks Francesco


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...


Do you mean checked? If so then it would be

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

Hope I understood that correctly

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号