0

だから私はプラグイン Contact Form 7 for WordPress を使用しています.2つのラジオボタンを備えたこのフォームがあります:

<input type="radio" name="investorlandlord" value="I'm an Investor">
<input type="radio" name="investorlandlord" value="I'm a Landlord" tabindex="1">

[私は投資家です] ボタンがチェックされている場合、その下に次のドロップダウンを表示する必要があります。

<select name="finance" class="wpcf7-form-control wpcf7-select" id="finance"><option value="Finance Available">Finance Available</option>...</select>

もう一方のボタンがチェックされている場合は、このドロップダウンが表示される必要があります。

<select name="properties" class="wpcf7-form-control wpcf7-select" id="properties"><option value="Number of Properties">Number of Properties</option>...</select>

WordPressでこれを行う簡単な方法はありますか?

4

1 に答える 1

0

ここでこれを使用して問題を解決しましたが、完璧に機能します:)

jQuery(function(){
               jQuery("input[name=investorlandlord]").change(function(){          


            if ($(this).val() == "I'm a Landlord") {
            jQuery("#properties").slideDown()
            }
            else {
            jQuery("#properties").slideUp();
            }                                                            
       });
    });
jQuery(function(){
        jQuery("input[name=investorlandlord]").change(function(){          


            if ($(this).val() == "I'm an Investor") {
            jQuery("#finance").slideDown()
            }
            else {
            jQuery("#finance").slideUp();
            }                                                            
});
});
于 2013-04-16T19:08:27.047 に答える