0
私はPHPに慣れていないので、私の問題を解決するための助けが必要です。phpドロップダウンオプションの値が0の場合、divを非表示にする
私はPHPのスニペットを貼り付け、私は編集が必要だと信じています。
<div class="selectBox" id="products-variation-container">
<select class="product-variation-dropdown" name="product-variation" id="sel-product-variation">
<option value="0"><?php _e('Select variation', 'wp-woo-leasing'); ?></option>
</select>
</div>
<!-- <input type="submit" name="btn-submit" class="button alt" id="leasingAddItem" value="<?php _e('Add Item', 'wp-woo-leasing'); ?>"
data-value="<?php _e('Add Item', 'wp-woo-leasing'); ?>" />-->
</div>
</div>
<div class="leasing-single-container" >
<div class="leasing-col1" >
<div id="product-description" class="product-description"></div>
<div id="product-price-details" class="product-price-details"></div>
</div>
私の問題は、私は私のコードは次のようになりたいということです。デフォルト値は0であるため、オプション値=「0」は、その後、積載サイト時に、次のdivを非表示にした場合
<select class="product-variation-dropdown" name="product-variation" id="sel-product-variation">
<option value="0"><?php _e('Select variation', 'wp-woo-leasing'); ?>
。
<div id="product-description" class="product-description"></div>
私の質問を理解していただければ幸いです。ありがとうございました。
..代わりにこのようなものを使用できます。代わりに0を試す –
は条件文または3項演算子を使用します。後者はより合理化されたソリューションです –
私はあなたの質問を得ることはありません、値0のオプションが選択されたときdivを非表示にしたいのですか、または選択されたオプションの値が0の場合divを非表示にするには? – Epodax