首页 > 解决方案 > 如何根据复选框限制选择框选项?

问题描述

我目前正在开发可以选择业务或专业角色的注册表单。我想将专业角色的选项限制为只能选择“交付”选项。我怎样才能做到这一点 ? 截图
这是我的网站网址如果它可以提供帮助。https://www.behealthy.asia/cp/

谢谢你

<div class="tab-pane fade in" id="company">
<form action="#" method="post" class="do-registration-form">
    <div class="form-group">
        <div class="tg-registeras">
            <span><?php esc_html_e('Register As', 'listingo_core'); ?>:</span>
            <div class="tg-radio">
                <input type="radio" class="register_type" value="business" id="business" name="register[type]" checked>
                <label for="business"><?php esc_html_e('Business', 'listingo_core'); ?></label>
            </div>
            <div class="tg-radio">
                <input type="radio" class="register_type" value="professional" id="professional" name="register[type]">
                <label for="professional"><?php esc_html_e('professional', 'listingo_core'); ?></label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <span class="tg-select">
            <select name="register[category]" class="sp-category">
                <option value=""><?php esc_html_e('Select Category', 'listingo_core'); ?></option>
                <?php listingo_get_categories('', 'sp_categories'); ?>
            </select>
        </span>
    </div>
    <?php if( apply_filters('listingo_dev_manage_fields','true','sub_category') === 'true' ){?>
    <div class="form-group">
        <span class="tg-select">
            <select name="register[sub_category][]" data-placeholder="<?php esc_html_e('Sub category', 'listingo'); ?>" multiple class="sp-sub-category sp-register-ms">
                <option value=""><?php esc_html_e('Select Sub Category', 'listingo_core'); ?></option>
            </select>
        </span>

标签: phpjqueryhtmlwordpress

解决方案


推荐阅读