我使用Modx eForm为我的表单。添加名称=需要与js(eForm Modx)
我的问题,我需要添加:需要几个输入字段,但只有当复选框未选中时!
我有这样的字段:
<input type="text" placeholder="Last name" id="deliver_lastname" name="deliver_lastname:required" class="[[!+fi.error.deliver_lastname:notempty=`error`]]" />
:要求取消选中需要的复选框后进行设置。
我有一个复选框默认隐藏一些字段。
<p id="shiptobilling" class="form-row">
Same as billing address <input type="checkbox" onclick="SetBilling(this.checked);" checked="checked" />
</p>
小脚本来隐藏与领域DIV进去:
<script type="text/javascript">
function SetBilling(checked) {
if (checked) {document.getElementById('deliveryaddres').style.display="none";}
else {document.getElementById('deliveryaddres').style.display="block";}
}
</script>
嗨,我不需要需要一个类,但名字= “布拉布拉:需要” – fourroses 2013-05-01 22:26:31
上面的代码没有设置所需的类,它实际上使符合HTML5的浏览器所需的字段。 – 2013-05-04 06:39:46