2013-04-16 139 views
0

所以我使用的插件聯繫表7 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中有沒有簡單的方法可以做到這一點?

+0

http://wordpress.org/extend/plugins/better-wordpress-showhide-elements/? – mplungjan

回答

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(); 
      }                
}); 
}); 
相關問題