复选框返回true(bool)php中
我希望当用户同意时复选框返回“true”。 你能帮我吗?
<form action="treat.php" method="POST">
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck" name="accept" value='' />
<label class="form-check-label" for="gridCheck">
I accept all conditions*
</label>
</div>
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button class="btn btn-primary" type="submit" name="">create your account!</button>
</div>
</form>
I would like that the checkbox returns 'true' when the user consent.
can you help me please?
<form action="treat.php" method="POST">
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck" name="accept" value='' />
<label class="form-check-label" for="gridCheck">
I accept all conditions*
</label>
</div>
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button class="btn btn-primary" type="submit" name="">create your account!</button>
</div>
</form>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试添加
value ='true'
布尔值为真或否,以便您只需填写true即可。try to add
value='true'
the boolean value is true or false so you can just fill value with true.