2013-04-16 140 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(); 
      }                
}); 
}); 
相关问题