我使用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